@rnw-community/nestjs-webpack-swc 0.27.1 → 0.27.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/readme.md +26 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rnw-community/nestjs-webpack-swc",
3
- "version": "0.27.1",
3
+ "version": "0.27.4",
4
4
  "private": false,
5
5
  "description": "NestJS typed config",
6
6
  "keywords": [
@@ -35,7 +35,7 @@
35
35
  "engines": {
36
36
  "node": ">=14.0.0"
37
37
  },
38
- "gitHead": "32e34a71dd3d8b52bf77d4b0d800fb8ed763ff80",
38
+ "gitHead": "b0f0f40980cf2e437e8ec2eb78082ba7e2b03331",
39
39
  "devDependencies": {
40
40
  "@types/webpack-env": "^1.18.0",
41
41
  "@types/webpack-node-externals": "^2.5.3",
package/readme.md CHANGED
@@ -51,7 +51,17 @@ Change `package.json` `build`, `start:dev` scripts:
51
51
  }
52
52
  ```
53
53
 
54
- ## Typeorm migrations
54
+ ### .gitignore
55
+
56
+ For maximum speed webpack is configured to generate [filesystem cache](https://webpack.js.org/configuration/cache/) and uses `.build_cache` folder
57
+ in package root, so you need to add it to your `.gitignore` file.
58
+
59
+ ## Possible webpack issues
60
+
61
+ Due to webpack bundling approach you may encounter problems with packages that use absolute/relative paths, each of this
62
+ cases needs separate solutions. Feel free to open an issue.
63
+
64
+ ### Typeorm migrations
55
65
 
56
66
  If your project is using [TypeORM](https://typeorm.io), then you will face problems with running migrations from NestJS app,
57
67
  this package provides utility for loading TypeORM migrations within webpack build.
@@ -77,16 +87,26 @@ this package provides utility for loading TypeORM migrations within webpack buil
77
87
  const migrations = importTypeormWebpackMigrations(require.context('./migration/', true, /\.ts$/u));
78
88
  ```
79
89
 
80
- ## SWC bindings
90
+ ## SWC possible issues
91
+
92
+ ### SWC bindings
81
93
 
82
94
  If your project is running inside the docker container and your host system has different architecture
83
95
  you may end up with `Error: Bindings not found` SWC error, this is happening because when you install
84
- [SWC](https://swc.rs) it uses the bindings for your host machine, to fix this you can add the following
85
- `package.json` script and add it to `postinstall` script:
96
+ [SWC](https://swc.rs) it uses the bindings for your host machine, to fix this:
97
+
98
+ 1. Create `.yarnrc` file in the project root:
99
+
100
+ ```plain
101
+ --ignore-engines true
102
+ --ignore-platform true
103
+ ```
104
+
105
+ 2. Add swc bindings dependencies:
86
106
 
87
107
  ```json
88
108
  {
89
- "swc-install-bindings": "npm install --no-save --loglevel=error --prefer-offline --no-audit --progress=false --force @swc/core-linux-arm64-musl @swc/core-linux-x64-musl",
90
- "postinstall": "yarn swc-install-bindings"
109
+ "@swc/core-linux-arm64-musl": "^1.2.242",
110
+ "@swc/core-linux-x64-musl": "^1.2.242"
91
111
  }
92
112
  ```