You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/recipes/swc.md
+23-1Lines changed: 23 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -193,12 +193,34 @@ Once the installation is complete, update the `package.json`/`jest.config.js` fi
193
193
{
194
194
"jest": {
195
195
"transform": {
196
-
"^.+\\.(t|j)s?$": "@swc/jest"
196
+
"^.+\\.(t|j)s?$": ["@swc/jest"]
197
197
}
198
198
}
199
199
}
200
200
```
201
201
202
+
Additionally you would need to add the following `transform` properties to your `.swcrc` file: `legacyDecorator`, `decoratorMetadata`:
203
+
204
+
```json
205
+
{
206
+
"$schema": "https://json.schemastore.org/swcrc",
207
+
"sourceMaps": true,
208
+
"jsc": {
209
+
"parser": {
210
+
"syntax": "typescript",
211
+
"decorators": true,
212
+
"dynamicImport": true
213
+
},
214
+
"transform": {
215
+
"legacyDecorator": true,
216
+
"decoratorMetadata": true
217
+
},
218
+
"baseUrl": "./"
219
+
},
220
+
"minify": false
221
+
}
222
+
```
223
+
202
224
If you use NestJS CLI Plugins in your project, you'll have to run `PluginMetadataGenerator` manually. Navigate to [this section](/recipes/swc#monorepo-and-cli-plugins) to learn more.
0 commit comments