@workleap/swc-configs 1.0.0 → 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 CHANGED
@@ -1,7 +1,19 @@
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
+
9
+ ## 1.0.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [#92](https://github.com/gsoft-inc/wl-web-configs/pull/92) [`66e8f10`](https://github.com/gsoft-inc/wl-web-configs/commit/66e8f1033a987523c65fe9e61f53dac6d2e38777) Thanks [@ofrogon](https://github.com/ofrogon)! - Migrate project from GitHub organization
14
+
3
15
  ## 1.0.0
4
16
 
5
17
  ### Major Changes
6
18
 
7
- - [#85](https://github.com/workleap/wl-web-configs/pull/85) [`bad2df7`](https://github.com/workleap/wl-web-configs/commit/bad2df75593fb70d431d73bdced653b157c50caa) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Updated TSUP configuration and added a new SWC config package
19
+ - [#85](https://github.com/gsoft-inc/wl-web-configs/pull/85) [`bad2df7`](https://github.com/gsoft-inc/wl-web-configs/commit/bad2df75593fb70d431d73bdced653b157c50caa) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Updated TSUP configuration and added a new SWC config package
package/README.md CHANGED
@@ -1,400 +1,24 @@
1
- # @workleap/swc-configs
1
+ # swc-configs
2
2
 
3
- ## Installation
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](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](../../LICENSE)
4
+ [![npm version](https://img.shields.io/npm/v/@workleap/swc-configs)](https://www.npmjs.com/package/@workleap/swc-configs)
24
5
 
25
6
  ## Usage
26
7
 
27
- ### Dev
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
- return defineDevConfig({
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
- Using a function allow the consumer to receive as argument a configuration object derived from the `DefaultDevConfig` object, including any additional properties added with predefined options.
12
+ View the [contributor's documentation](../../CONTRIBUTING.md).
389
13
 
390
- ## Maintainers notes
14
+ ### Notes
391
15
 
392
- ### CJS support
16
+ #### CJS support
393
17
 
394
- To support CJS projects, the package is build for ESM and CJS formats. To support CJS, `type: "module"` has been temporary removed from the `package.json` file.
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
 
396
20
  Once all our projects use ESM, CJS support can be removed.
397
21
 
398
22
  ## License
399
23
 
400
- Copyright © 2023, GSoft inc. 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/gsoft-license/blob/master/LICENSE.
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.
@@ -0,0 +1,9 @@
1
+ import { Config } from '@swc/core';
2
+
3
+ interface SwcConfigTransformerContext {
4
+ environment: "dev" | "build" | "jest";
5
+ }
6
+ type SwcConfigTransformer = (config: Config, context: SwcConfigTransformerContext) => Config;
7
+ declare function applyTransformers(config: Config, transformers: SwcConfigTransformer[], context: SwcConfigTransformerContext): Config;
8
+
9
+ export { SwcConfigTransformer, SwcConfigTransformerContext, applyTransformers };
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ // src/applyTransformers.ts
4
+ function applyTransformers(config, transformers, context) {
5
+ return transformers.reduce((acc, transformer) => transformer(acc, context), config);
6
+ }
7
+
8
+ exports.applyTransformers = applyTransformers;
@@ -0,0 +1 @@
1
+ export { applyTransformers } from './chunk-3UBBOKDF.mjs';
package/dist/build.d.ts CHANGED
@@ -1,35 +1,11 @@
1
1
  import { Config } from '@swc/core';
2
- import { ConfigOverride } from './resolveOverrides.js';
2
+ import { SwcConfigTransformer } from './applyTransformers.js';
3
3
 
4
- declare const DefaultBuildConfig: {
5
- jsc: {
6
- parser: {
7
- syntax: "typescript";
8
- tsx: true;
9
- };
10
- target: "es2022";
11
- minify: {
12
- compress: true;
13
- mangle: true;
14
- };
15
- transform: {
16
- react: {
17
- runtime: "automatic";
18
- useBuiltins: true;
19
- };
20
- };
21
- externalHelpers: true;
22
- };
23
- module: {
24
- type: "es6";
25
- strict: true;
26
- ignoreDynamic: true;
27
- };
28
- };
29
4
  interface DefineBuildConfigOptions {
30
- parser?: "ecmascript";
31
- configOverride?: ConfigOverride;
5
+ browsers: any;
6
+ parser?: "ecmascript" | "typescript";
7
+ transformers?: SwcConfigTransformer[];
32
8
  }
33
- declare function defineBuildConfig({ parser, configOverride }?: DefineBuildConfigOptions): Config;
9
+ declare function defineBuildConfig(options: DefineBuildConfigOptions): Config;
34
10
 
35
- export { DefaultBuildConfig, DefineBuildConfigOptions, defineBuildConfig };
11
+ export { DefineBuildConfigOptions, defineBuildConfig };
package/dist/build.js CHANGED
@@ -1,72 +1,61 @@
1
1
  'use strict';
2
2
 
3
- // src/cloneObjectExceptFunctions.ts
4
- function cloneObjectExceptFunctions(obj) {
5
- return JSON.parse(JSON.stringify(obj));
6
- }
7
-
8
- // src/resolveOverrides.ts
9
- function resolveOverrides(config, configOverride) {
10
- if (typeof configOverride === "function") {
11
- return {
12
- ...config,
13
- ...configOverride(config)
14
- };
15
- }
16
- if (configOverride) {
17
- return {
18
- ...config,
19
- ...configOverride
20
- };
21
- }
22
- return config;
3
+ // src/applyTransformers.ts
4
+ function applyTransformers(config, transformers, context) {
5
+ return transformers.reduce((acc, transformer) => transformer(acc, context), config);
23
6
  }
24
7
 
25
8
  // src/build.ts
26
- var DefaultBuildConfig = {
27
- jsc: {
28
- parser: {
29
- syntax: "typescript",
30
- tsx: true
31
- },
32
- // The output environment that the code will be compiled for.
33
- target: "es2022",
34
- // View https://swc.rs/docs/configuration/minification for options.
35
- minify: {
36
- compress: true,
37
- mangle: true
9
+ function defineBuildConfig(options) {
10
+ const {
11
+ browsers,
12
+ parser = "typescript",
13
+ transformers = []
14
+ } = options;
15
+ const config = {
16
+ jsc: {
17
+ parser: parser === "ecmascript" ? {
18
+ syntax: "ecmascript",
19
+ jsx: true
20
+ } : {
21
+ syntax: "typescript",
22
+ tsx: true
23
+ },
24
+ // The output environment that the code will be compiled for.
25
+ target: "esnext",
26
+ // View https://swc.rs/docs/configuration/minification for options.
27
+ minify: {
28
+ compress: true,
29
+ mangle: true
30
+ },
31
+ transform: {
32
+ react: {
33
+ // Use "react/jsx-runtime".
34
+ runtime: "automatic",
35
+ // Use the native "Object.assign()" instead of "_extends".
36
+ useBuiltins: true
37
+ }
38
+ },
39
+ // Import shims from an external module rather than inlining them in bundle files to greatly reduce the bundles size.
40
+ // Requires to add "@swc/helpers" as a project dependency.
41
+ externalHelpers: true
38
42
  },
39
- transform: {
40
- react: {
41
- // Use "react/jsx-runtime".
42
- runtime: "automatic",
43
- // Use the native "Object.assign()" instead of "_extends".
44
- useBuiltins: true
45
- }
43
+ module: {
44
+ // The output module resolution system that the code will be compiled for.
45
+ type: "es6",
46
+ // Prevent SWC from exporting the `__esModule` property.
47
+ strict: true,
48
+ // Preserve dynamic imports.
49
+ ignoreDynamic: true
46
50
  },
47
- // Import shims from an external module rather than inlining them in bundle files to greatly reduce the bundles size.
48
- // Requires to add "@swc/helpers" as a project dependency
49
- externalHelpers: true
50
- },
51
- module: {
52
- // The output module resolution system that the code will be compiled for.
53
- type: "es6",
54
- // Prevent SWC from exporting the `__esModule` property.
55
- strict: true,
56
- // Preserve dynamic imports.
57
- ignoreDynamic: true
58
- }
59
- };
60
- function defineBuildConfig({ parser, configOverride } = {}) {
61
- const config = cloneObjectExceptFunctions(DefaultBuildConfig);
62
- if (parser === "ecmascript") {
63
- config.jsc.parser = {
64
- syntax: "ecmascript",
65
- jsx: true
66
- };
67
- }
68
- return resolveOverrides(config, configOverride);
51
+ env: {
52
+ targets: browsers
53
+ }
54
+ };
55
+ const transformedConfig = applyTransformers(config, transformers, {
56
+ environment: "build"
57
+ });
58
+ return transformedConfig;
69
59
  }
70
60
 
71
- exports.DefaultBuildConfig = DefaultBuildConfig;
72
61
  exports.defineBuildConfig = defineBuildConfig;
package/dist/build.mjs CHANGED
@@ -1,3 +1,2 @@
1
- export { DefaultBuildConfig, defineBuildConfig } from './chunk-JW562DWU.mjs';
2
- import './chunk-XCGQZSNA.mjs';
3
- import './chunk-4LXCYXR5.mjs';
1
+ export { defineBuildConfig } from './chunk-5BJAOXJX.mjs';
2
+ import './chunk-3UBBOKDF.mjs';
@@ -0,0 +1,6 @@
1
+ // src/applyTransformers.ts
2
+ function applyTransformers(config, transformers, context) {
3
+ return transformers.reduce((acc, transformer) => transformer(acc, context), config);
4
+ }
5
+
6
+ export { applyTransformers };
@@ -0,0 +1,56 @@
1
+ import { applyTransformers } from './chunk-3UBBOKDF.mjs';
2
+
3
+ // src/build.ts
4
+ function defineBuildConfig(options) {
5
+ const {
6
+ browsers,
7
+ parser = "typescript",
8
+ transformers = []
9
+ } = options;
10
+ const config = {
11
+ jsc: {
12
+ parser: parser === "ecmascript" ? {
13
+ syntax: "ecmascript",
14
+ jsx: true
15
+ } : {
16
+ syntax: "typescript",
17
+ tsx: true
18
+ },
19
+ // The output environment that the code will be compiled for.
20
+ target: "esnext",
21
+ // View https://swc.rs/docs/configuration/minification for options.
22
+ minify: {
23
+ compress: true,
24
+ mangle: true
25
+ },
26
+ transform: {
27
+ react: {
28
+ // Use "react/jsx-runtime".
29
+ runtime: "automatic",
30
+ // Use the native "Object.assign()" instead of "_extends".
31
+ useBuiltins: true
32
+ }
33
+ },
34
+ // Import shims from an external module rather than inlining them in bundle files to greatly reduce the bundles size.
35
+ // Requires to add "@swc/helpers" as a project dependency.
36
+ externalHelpers: true
37
+ },
38
+ module: {
39
+ // The output module resolution system that the code will be compiled for.
40
+ type: "es6",
41
+ // Prevent SWC from exporting the `__esModule` property.
42
+ strict: true,
43
+ // Preserve dynamic imports.
44
+ ignoreDynamic: true
45
+ },
46
+ env: {
47
+ targets: browsers
48
+ }
49
+ };
50
+ const transformedConfig = applyTransformers(config, transformers, {
51
+ environment: "build"
52
+ });
53
+ return transformedConfig;
54
+ }
55
+
56
+ export { defineBuildConfig };