@gravity-ui/app-builder 0.15.1-beta.5 → 0.15.1-beta.6
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.
|
@@ -207,6 +207,10 @@ export interface ClientConfig {
|
|
|
207
207
|
moduleType?: 'commonjs' | 'esm';
|
|
208
208
|
};
|
|
209
209
|
bundler?: Bundler;
|
|
210
|
+
/**
|
|
211
|
+
* Code loader. `babel` is default.
|
|
212
|
+
* `swc` is experimental and supported only in `rspack` bundler
|
|
213
|
+
*/
|
|
210
214
|
codeLoader?: 'babel' | 'swc';
|
|
211
215
|
}
|
|
212
216
|
export interface CdnUploadConfig {
|
|
@@ -371,6 +371,10 @@ function configureOutput(options) {
|
|
|
371
371
|
}
|
|
372
372
|
function createJavaScriptLoader({ isEnvProduction, isEnvDevelopment, configType, config, isSsr, }) {
|
|
373
373
|
if (config.codeLoader === 'swc') {
|
|
374
|
+
if (config.bundler !== 'rspack') {
|
|
375
|
+
throw new Error('SWC is supported only with rspack bundler');
|
|
376
|
+
}
|
|
377
|
+
const browserslist = require('browserslist');
|
|
374
378
|
return {
|
|
375
379
|
loader: 'builtin:swc-loader',
|
|
376
380
|
options: {
|
|
@@ -378,9 +382,11 @@ function createJavaScriptLoader({ isEnvProduction, isEnvDevelopment, configType,
|
|
|
378
382
|
env: {
|
|
379
383
|
loose: true,
|
|
380
384
|
bugfixes: true,
|
|
385
|
+
targets: browserslist(),
|
|
381
386
|
},
|
|
382
387
|
module: {
|
|
383
388
|
type: 'es6',
|
|
389
|
+
noInterop: true,
|
|
384
390
|
},
|
|
385
391
|
assumptions: {
|
|
386
392
|
setPublicClassFields: true,
|
|
@@ -390,6 +396,8 @@ function createJavaScriptLoader({ isEnvProduction, isEnvDevelopment, configType,
|
|
|
390
396
|
parser: {
|
|
391
397
|
syntax: 'typescript',
|
|
392
398
|
tsx: true,
|
|
399
|
+
decorators: true,
|
|
400
|
+
dynamicImport: true,
|
|
393
401
|
},
|
|
394
402
|
transform: {
|
|
395
403
|
react: {
|
package/package.json
CHANGED