@workleap/swc-configs 1.0.1 → 2.0.0
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.
- package/CHANGELOG.md +6 -0
- package/README.md +9 -385
- package/dist/build.js +1 -1
- package/dist/build.mjs +1 -1
- package/dist/{chunk-UFEY2RGG.mjs → chunk-5BJAOXJX.mjs} +1 -1
- package/dist/{chunk-6PUKUTDM.mjs → chunk-MYINGMHM.mjs} +1 -1
- package/dist/{chunk-LPGVRYUE.mjs → chunk-YG2X6TFX.mjs} +1 -1
- package/dist/dev.js +1 -1
- package/dist/dev.mjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/index.mjs +3 -3
- package/dist/jest.js +1 -1
- package/dist/jest.mjs +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @workleap/swc-configs
|
|
2
2
|
|
|
3
|
+
## 2.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#98](https://github.com/gsoft-inc/wl-web-configs/pull/98) [`56ca32e`](https://github.com/gsoft-inc/wl-web-configs/commit/56ca32ee3194c51210aacc5189f3ebbec5a4a7b6) Thanks [@patricklafrance](https://github.com/patricklafrance)! - New start, every package has a major version bump
|
|
8
|
+
|
|
3
9
|
## 1.0.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,395 +1,19 @@
|
|
|
1
|
-
#
|
|
1
|
+
# swc-configs
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Install the following packages:
|
|
6
|
-
|
|
7
|
-
**With pnpm**
|
|
8
|
-
|
|
9
|
-
```shell
|
|
10
|
-
pnpm add -D @workleap/swc-configs @swc/core @swc/helpers
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
**With yarn**
|
|
14
|
-
|
|
15
|
-
```shell
|
|
16
|
-
yarn add -D @workleap/swc-configs @swc/core @swc/helpers
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
**With npm**
|
|
20
|
-
|
|
21
|
-
```shell
|
|
22
|
-
npm install -D @workleap/swc-configs @swc/core @swc/helpers
|
|
23
|
-
```
|
|
3
|
+
[](../../LICENSE)
|
|
4
|
+
[](https://www.npmjs.com/package/@workleap/swc-configs)
|
|
24
5
|
|
|
25
6
|
## Usage
|
|
26
7
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
Create a `swc.dev.js` file at the root of your project:
|
|
30
|
-
|
|
31
|
-
```
|
|
32
|
-
root
|
|
33
|
-
|---/src
|
|
34
|
-
|---swc.dev.js
|
|
35
|
-
|---webpack.dev.js
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
Then, in the newly created file, import and execute the `defineDevConfig` function to export a valid SWC configuration object:
|
|
39
|
-
|
|
40
|
-
```ts
|
|
41
|
-
// swc.dev.js
|
|
42
|
-
|
|
43
|
-
import { defineDevConfig } from "@workleap/swc-configs";
|
|
44
|
-
|
|
45
|
-
export const swcConfig = defineDevConfig();
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
Finally, install the Webpack [swc-loader](https://swc.rs/docs/usage/swc-loader) package and add the following `rule` to your Webpack configuration:
|
|
49
|
-
|
|
50
|
-
```js
|
|
51
|
-
// webpack.dev.js
|
|
52
|
-
|
|
53
|
-
// @ts-check
|
|
54
|
-
|
|
55
|
-
import { swcConfig } from "./swc.dev.js";
|
|
56
|
-
|
|
57
|
-
/** @type {import("webpack").Configuration} */
|
|
58
|
-
export default {
|
|
59
|
-
module: {
|
|
60
|
-
rules: {
|
|
61
|
-
test: /\.(ts|tsx)/i,
|
|
62
|
-
exclude: /node_modules/,
|
|
63
|
-
use: {
|
|
64
|
-
loader: "swc-loader",
|
|
65
|
-
options: swcConfig
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
> The rule declaration may vary depending of your project configuration. For example, you might want to change the `test` property to target ECMAScript files instead: `test: /\.(js|jsx)/i`.
|
|
73
|
-
|
|
74
|
-
#### Customizing the configuration
|
|
75
|
-
|
|
76
|
-
If you wish to customize the default development configuration, there are a few possibilities.
|
|
77
|
-
|
|
78
|
-
##### Use predefined options
|
|
79
|
-
|
|
80
|
-
The `defineDevConfig` function accepts predefined options to customize the default SWC configuration without having to learn any [SWC specific configuration syntax](https://swc.rs/docs/configuration/swcrc) or mangling with complicated configuration properties.
|
|
81
|
-
|
|
82
|
-
To enable [React fast refresh](https://github.com/pmmmwh/react-refresh-webpack-plugin), use the `fastRefresh` option:
|
|
83
|
-
|
|
84
|
-
```ts
|
|
85
|
-
// swc.dev.js
|
|
86
|
-
|
|
87
|
-
import { defineDevConfig } from "@workleap/swc-configs";
|
|
88
|
-
|
|
89
|
-
return defineDevConfig({
|
|
90
|
-
fastRefresh: true
|
|
91
|
-
});
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
> Don't forget to install [ReactRefreshWebpackPlugin](https://github.com/pmmmwh/react-refresh-webpack-plugin) and update your Webpack configuration accordingly.
|
|
95
|
-
|
|
96
|
-
The development configuration expect to parse TypeScript code. If your project is coded with regular JavaScript (ECMAScript), use the `parser` option to configure SWC to parse regular JavaScript code rather than TypeScript code:
|
|
97
|
-
|
|
98
|
-
```ts
|
|
99
|
-
// swc.dev.js
|
|
100
|
-
|
|
101
|
-
import { defineDevConfig } from "@workleap/swc-configs";
|
|
102
|
-
|
|
103
|
-
return defineDevConfig({
|
|
104
|
-
parser: "ecmascript"
|
|
105
|
-
});
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
##### Manually overriding SWC configuration
|
|
109
|
-
|
|
110
|
-
Refer to the [configuration override](#configuration-override) section.
|
|
111
|
-
|
|
112
|
-
### Build
|
|
113
|
-
|
|
114
|
-
Create a `swc.build.js` file at the root of your project:
|
|
115
|
-
|
|
116
|
-
```
|
|
117
|
-
root
|
|
118
|
-
|---/src
|
|
119
|
-
|---swc.build.js
|
|
120
|
-
|---webpack.build.js
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
Then, in the newly created file, import and execute the `defineBuildConfig` function to export a valid SWC configuration object:
|
|
124
|
-
|
|
125
|
-
```ts
|
|
126
|
-
// swc.build.js
|
|
127
|
-
|
|
128
|
-
import { defineBuildConfig } from "@workleap/swc-configs";
|
|
129
|
-
|
|
130
|
-
export const swcConfig = defineBuildConfig();
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
Finally, install the Webpack [swc-loader](https://swc.rs/docs/usage/swc-loader) package and add the following `rule` to your Webpack configuration:
|
|
134
|
-
|
|
135
|
-
```js
|
|
136
|
-
// webpack.build.js
|
|
137
|
-
|
|
138
|
-
// @ts-check
|
|
139
|
-
|
|
140
|
-
import { swcConfig } from "./swc.build.js";
|
|
141
|
-
|
|
142
|
-
/** @type {import("webpack").Configuration} */
|
|
143
|
-
export default {
|
|
144
|
-
module: {
|
|
145
|
-
rules: {
|
|
146
|
-
test: /\.(ts|tsx)/i,
|
|
147
|
-
exclude: /node_modules/,
|
|
148
|
-
use: {
|
|
149
|
-
loader: "swc-loader",
|
|
150
|
-
options: swcConfig
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
#### Customizing the configuration
|
|
158
|
-
|
|
159
|
-
If you wish to customize the default build configuration, there are a few possibilities.
|
|
160
|
-
|
|
161
|
-
##### Use predefined options
|
|
162
|
-
|
|
163
|
-
The `defineBuildConfig` function accepts predefined options to customize the default SWC configuration without having to learn any [SWC specific configuration syntax](https://swc.rs/docs/configuration/swcrc) or mangling with complicated configuration properties.
|
|
164
|
-
|
|
165
|
-
The build configuration expect to parse TypeScript code. If your project is coded with regular JavaScript (ECMAScript), use the `parser` option to configure SWC to parse regular JavaScript code rather than TypeScript code:
|
|
166
|
-
|
|
167
|
-
```ts
|
|
168
|
-
// swc.build.js
|
|
169
|
-
|
|
170
|
-
import { defineBuildConfig } from "@workleap/swc-configs";
|
|
171
|
-
|
|
172
|
-
return defineBuildConfig({
|
|
173
|
-
parser: "ecmascript"
|
|
174
|
-
});
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
##### Manually overriding SWC configuration
|
|
178
|
-
|
|
179
|
-
Refer to the [configuration override](#configuration-override) section.
|
|
180
|
-
|
|
181
|
-
### Jest
|
|
182
|
-
|
|
183
|
-
#### Installation
|
|
184
|
-
|
|
185
|
-
First install the following package:
|
|
186
|
-
|
|
187
|
-
**With pnpm**
|
|
188
|
-
|
|
189
|
-
```shell
|
|
190
|
-
pnpm add -D @swc/jest
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
**With yarn**
|
|
194
|
-
|
|
195
|
-
```shell
|
|
196
|
-
yarn add -D @swc/jest
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
**With npm**
|
|
200
|
-
|
|
201
|
-
```shell
|
|
202
|
-
yarn add -D @swc/jest
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
#### Usage
|
|
206
|
-
|
|
207
|
-
Create a `swc.jest.ts` file at the root of your project:
|
|
208
|
-
|
|
209
|
-
```
|
|
210
|
-
root
|
|
211
|
-
|---/src
|
|
212
|
-
|---swc.jest.ts
|
|
213
|
-
|---jest.config.ts
|
|
214
|
-
```
|
|
215
|
-
|
|
216
|
-
Then, in the newly created file, import and execute the `defineJestConfig` function to export a valid SWC configuration object:
|
|
217
|
-
|
|
218
|
-
```ts
|
|
219
|
-
// swc.jest.ts
|
|
220
|
-
|
|
221
|
-
import { defineJestConfig } from "@workleap/swc-configs";
|
|
222
|
-
|
|
223
|
-
export const swcConfig = defineJestConfig();
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
Finally, add the following Jest [code transform](https://jestjs.io/docs/code-transformation) to your `jest.config.ts` file:
|
|
227
|
-
|
|
228
|
-
```js
|
|
229
|
-
// jest.config.ts
|
|
230
|
-
|
|
231
|
-
import { swcCnfig } from "./swc.jest.ts";
|
|
232
|
-
|
|
233
|
-
const config = {
|
|
234
|
-
transform: {
|
|
235
|
-
"^.+\\.(ts|tsx)$": ["@swc/jest", swcConfig as Record<string, unknown>]
|
|
236
|
-
}
|
|
237
|
-
};
|
|
238
|
-
```
|
|
239
|
-
|
|
240
|
-
> The transform declaration may vary depending of your project configuration. For example, you might want to change the file extensions to target ECMAScript files instead: `^.+\\.(js|jsx)$`.
|
|
241
|
-
|
|
242
|
-
#### Customizing the configuration
|
|
243
|
-
|
|
244
|
-
If you wish to customize the default Jest configuration, there are a few possibilities.
|
|
245
|
-
|
|
246
|
-
##### Use predefined options
|
|
247
|
-
|
|
248
|
-
The `defineJestConfig` function accepts predefined options to customize the default SWC configuration without having to learn any [SWC specific configuration syntax](https://swc.rs/docs/configuration/swcrc) or mangling with complicated configuration properties.
|
|
249
|
-
|
|
250
|
-
The default Jest configuration doesn't include React. To include React, use the `react` option:
|
|
251
|
-
|
|
252
|
-
```ts
|
|
253
|
-
// swc.jest.ts
|
|
254
|
-
|
|
255
|
-
import { defineJestConfig } from "@workleap/swc-configs";
|
|
256
|
-
|
|
257
|
-
return defineJestConfig({
|
|
258
|
-
react: true
|
|
259
|
-
});
|
|
260
|
-
```
|
|
261
|
-
|
|
262
|
-
The Jest configuration expect to parse TypeScript code. If your project is coded with regular JavaScript (ECMAScript), use the `parser` option to configure SWC to parse regular JavaScript code rather than TypeScript code:
|
|
263
|
-
|
|
264
|
-
```ts
|
|
265
|
-
// swc.jest.ts
|
|
266
|
-
|
|
267
|
-
import { defineJestConfig } from "@workleap/swc-configs";
|
|
268
|
-
|
|
269
|
-
return defineJestConfig({
|
|
270
|
-
parser: "ecmascript"
|
|
271
|
-
});
|
|
272
|
-
```
|
|
273
|
-
|
|
274
|
-
##### Manually overriding SWC configuration
|
|
275
|
-
|
|
276
|
-
Refer to the [configuration override](#configuration-override) section.
|
|
277
|
-
|
|
278
|
-
### Configuration override
|
|
279
|
-
|
|
280
|
-
> This documentation section will use the [Dev configuration](#dev) `defineDevConfig` function and `DefaultDevConfig` object to showcase examples but keep in mind that it also available for the [Build](#build) and [Jest](#jest) configurations.
|
|
281
|
-
|
|
282
|
-
All "define" functions accepts a `configOverride` property. This property allow the consumer to override any property of the default SWC configuration. The `configOverride` supports 2 syntaxes, a [custom object](#custom-object) and a [function](#function).
|
|
283
|
-
|
|
284
|
-
It's important to note that with both syntaxes, the provided configuration **will not** be merged with the default configuration, it will override any matching properties of the default configuration.
|
|
285
|
-
|
|
286
|
-
#### Custom object
|
|
287
|
-
|
|
288
|
-
The easiest way to override manually the SWC config is with the object syntax:
|
|
289
|
-
|
|
290
|
-
```ts
|
|
291
|
-
// swc.dev.ts
|
|
292
|
-
|
|
293
|
-
import { defineDevConfig } from "@workleap/swc-configs";
|
|
294
|
-
|
|
295
|
-
return defineDevConfig({
|
|
296
|
-
configOverride: {
|
|
297
|
-
jsc: {
|
|
298
|
-
parser: {
|
|
299
|
-
dynamicImport: true
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
});
|
|
304
|
-
```
|
|
305
|
-
|
|
306
|
-
In the previous example, the whole `jsx` section of the default configuration would be overrided for:
|
|
307
|
-
|
|
308
|
-
```js
|
|
309
|
-
jsc: {
|
|
310
|
-
parser: {
|
|
311
|
-
dynamicImport: true
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
```
|
|
315
|
-
|
|
316
|
-
While in some cases it's fine, often a consumer would prefer to extend the default configuration rather than overriding it's properties. To extend the configuration, use the `DefaultDevConfig` object to merge new properties with the default configuration properties:
|
|
317
|
-
|
|
318
|
-
```ts
|
|
319
|
-
// swc.dev.ts
|
|
320
|
-
|
|
321
|
-
import { defineDevConfig, DefaultDevConfig } from "@workleap/swc-configs";
|
|
322
|
-
import merge from "deepmerge";
|
|
323
|
-
|
|
324
|
-
return defineDevConfig({
|
|
325
|
-
configOverride: merge.all(DefaultDevConfig, {
|
|
326
|
-
jsc: {
|
|
327
|
-
parser: {
|
|
328
|
-
dynamicImport: true
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
})
|
|
332
|
-
});
|
|
333
|
-
```
|
|
334
|
-
|
|
335
|
-
##### Function
|
|
336
|
-
|
|
337
|
-
The `configOverride` property also accept a function. While there are a wide range of additional use cases that can be solved with a function, the main purpose of using a function here is to allow mixing **predefined options** with a **custom configuration object**.
|
|
338
|
-
|
|
339
|
-
Take the following example:
|
|
340
|
-
|
|
341
|
-
```ts
|
|
342
|
-
// swc.dev.ts
|
|
343
|
-
|
|
344
|
-
import { defineDevConfig, DefaultDevConfig } from "@workleap/swc-configs";
|
|
345
|
-
import merge from "deepmerge";
|
|
346
|
-
|
|
347
|
-
return defineDevConfig({
|
|
348
|
-
fastRefresh: true,
|
|
349
|
-
configOverride: merge.all(DefaultDevConfig, {
|
|
350
|
-
jsc: {
|
|
351
|
-
parser: {
|
|
352
|
-
dynamicImport: true
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
})
|
|
356
|
-
});
|
|
357
|
-
```
|
|
358
|
-
|
|
359
|
-
In this example, the consumer wish to enable [React fast refresh](https://github.com/pmmmwh/react-refresh-webpack-plugin) and ESM dynamic imports. That's a good idea to use the `fastRefresh` predefined options to enable fast refresh. However, since there are no predefined option to enable ESM dynamic imports, a custom configuration object must be provided to extend the `jsc.parser` section with the `dynamicImport` property.
|
|
360
|
-
|
|
361
|
-
Given that the consumer extends the configuration rather than overriding it, one could expect that the React fast refresh configuration will be included in the final configuration.
|
|
362
|
-
|
|
363
|
-
Wrong, the React fast refresh configuration won't be included because it's not part of the `DefaultDevConfig` object that the consumer is extending.
|
|
364
|
-
|
|
365
|
-
To extend the default development configuration and also use predefined options, you must provide a function rather than an object:
|
|
366
|
-
|
|
367
|
-
```ts
|
|
368
|
-
// swc.dev.ts
|
|
369
|
-
|
|
370
|
-
import { defineDevConfig, DefaultDevConfig } from "@workleap/swc-configs";
|
|
371
|
-
import merge from "deepmerge";
|
|
8
|
+
View the [user's documentation](https://gsoft-inc.github.io/wl-web-configs/).
|
|
372
9
|
|
|
373
|
-
|
|
374
|
-
fastRefresh: true,
|
|
375
|
-
configOverride: (config) => {
|
|
376
|
-
// The "config" argument is the DefaultDevConfig object including the fast refresh configuration.
|
|
377
|
-
return merge.all(config, {
|
|
378
|
-
jsc: {
|
|
379
|
-
parser: {
|
|
380
|
-
dynamicImport: true
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
});
|
|
384
|
-
}
|
|
385
|
-
});
|
|
386
|
-
```
|
|
10
|
+
## 🤝 Contributing
|
|
387
11
|
|
|
388
|
-
|
|
12
|
+
View the [contributor's documentation](../../CONTRIBUTING.md).
|
|
389
13
|
|
|
390
|
-
|
|
14
|
+
### Notes
|
|
391
15
|
|
|
392
|
-
|
|
16
|
+
#### CJS support
|
|
393
17
|
|
|
394
18
|
To support CJS projects, this package is build for ESM and CJS formats. To support CJS, `type: "module"` has been temporary removed from the `package.json` file.
|
|
395
19
|
|
|
@@ -397,4 +21,4 @@ Once all our projects use ESM, CJS support can be removed.
|
|
|
397
21
|
|
|
398
22
|
## License
|
|
399
23
|
|
|
400
|
-
Copyright © 2023,
|
|
24
|
+
Copyright © 2023, Workleap. This code is licensed under the Apache License, Version 2.0. You may obtain a copy of this license at https://github.com/gsoft-inc/workleap-license/blob/master/LICENSE.
|
package/dist/build.js
CHANGED
|
@@ -22,7 +22,7 @@ function defineBuildConfig(options) {
|
|
|
22
22
|
tsx: true
|
|
23
23
|
},
|
|
24
24
|
// The output environment that the code will be compiled for.
|
|
25
|
-
target: "
|
|
25
|
+
target: "esnext",
|
|
26
26
|
// View https://swc.rs/docs/configuration/minification for options.
|
|
27
27
|
minify: {
|
|
28
28
|
compress: true,
|
package/dist/build.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { defineBuildConfig } from './chunk-
|
|
1
|
+
export { defineBuildConfig } from './chunk-5BJAOXJX.mjs';
|
|
2
2
|
import './chunk-3UBBOKDF.mjs';
|
|
@@ -17,7 +17,7 @@ function defineBuildConfig(options) {
|
|
|
17
17
|
tsx: true
|
|
18
18
|
},
|
|
19
19
|
// The output environment that the code will be compiled for.
|
|
20
|
-
target: "
|
|
20
|
+
target: "esnext",
|
|
21
21
|
// View https://swc.rs/docs/configuration/minification for options.
|
|
22
22
|
minify: {
|
|
23
23
|
compress: true,
|
package/dist/dev.js
CHANGED
package/dist/dev.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { defineDevConfig } from './chunk-
|
|
1
|
+
export { defineDevConfig } from './chunk-YG2X6TFX.mjs';
|
|
2
2
|
import './chunk-3UBBOKDF.mjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
export { Config as SwcConfig } from '@swc/core';
|
|
1
2
|
export { SwcConfigTransformer, SwcConfigTransformerContext } from './applyTransformers.js';
|
|
2
3
|
export { DefineBuildConfigOptions, defineBuildConfig } from './build.js';
|
|
3
4
|
export { DefineDevConfigOptions, defineDevConfig } from './dev.js';
|
|
4
5
|
export { DefineJestConfigOptions, defineJestConfig } from './jest.js';
|
|
5
|
-
import '@swc/core';
|
package/dist/index.js
CHANGED
|
@@ -22,7 +22,7 @@ function defineBuildConfig(options) {
|
|
|
22
22
|
tsx: true
|
|
23
23
|
},
|
|
24
24
|
// The output environment that the code will be compiled for.
|
|
25
|
-
target: "
|
|
25
|
+
target: "esnext",
|
|
26
26
|
// View https://swc.rs/docs/configuration/minification for options.
|
|
27
27
|
minify: {
|
|
28
28
|
compress: true,
|
|
@@ -76,7 +76,7 @@ function defineDevConfig(options) {
|
|
|
76
76
|
tsx: true
|
|
77
77
|
},
|
|
78
78
|
// The output environment that the code will be compiled for.
|
|
79
|
-
target: "
|
|
79
|
+
target: "esnext",
|
|
80
80
|
transform: {
|
|
81
81
|
react: {
|
|
82
82
|
// Use "react/jsx-runtime".
|
|
@@ -127,7 +127,7 @@ function defineJestConfig(options = {}) {
|
|
|
127
127
|
tsx: react
|
|
128
128
|
},
|
|
129
129
|
// The output environment that the code will be compiled for.
|
|
130
|
-
target: "
|
|
130
|
+
target: "esnext",
|
|
131
131
|
transform: react ? {
|
|
132
132
|
react: {
|
|
133
133
|
// Use "react/jsx-runtime".
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { defineBuildConfig } from './chunk-
|
|
2
|
-
export { defineDevConfig } from './chunk-
|
|
3
|
-
export { defineJestConfig } from './chunk-
|
|
1
|
+
export { defineBuildConfig } from './chunk-5BJAOXJX.mjs';
|
|
2
|
+
export { defineDevConfig } from './chunk-YG2X6TFX.mjs';
|
|
3
|
+
export { defineJestConfig } from './chunk-MYINGMHM.mjs';
|
|
4
4
|
import './chunk-3UBBOKDF.mjs';
|
package/dist/jest.js
CHANGED
package/dist/jest.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { defineJestConfig } from './chunk-
|
|
1
|
+
export { defineJestConfig } from './chunk-MYINGMHM.mjs';
|
|
2
2
|
import './chunk-3UBBOKDF.mjs';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workleap/swc-configs",
|
|
3
3
|
"description": "Workleap recommended SWC configs.",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "2.0.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"workleap",
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
"ts-node": "10.9.1",
|
|
36
36
|
"tsup": "6.7.0",
|
|
37
37
|
"typescript": "5.0.4",
|
|
38
|
-
"@workleap/eslint-plugin": "
|
|
39
|
-
"@workleap/tsup-configs": "
|
|
40
|
-
"@workleap/typescript-configs": "
|
|
38
|
+
"@workleap/eslint-plugin": "2.0.0",
|
|
39
|
+
"@workleap/tsup-configs": "3.0.0",
|
|
40
|
+
"@workleap/typescript-configs": "3.0.0"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"@swc/core": "*",
|