@gravity-ui/app-builder 0.15.1-beta.6 → 0.15.1-beta.7
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,11 +207,6 @@ 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
|
-
*/
|
|
214
|
-
codeLoader?: 'babel' | 'swc';
|
|
215
210
|
}
|
|
216
211
|
export interface CdnUploadConfig {
|
|
217
212
|
bucket: string;
|
|
@@ -146,7 +146,7 @@ async function rspackConfigFactory(options) {
|
|
|
146
146
|
output: configureOutput(helperOptions),
|
|
147
147
|
resolve: configureRspackResolve(helperOptions),
|
|
148
148
|
module: {
|
|
149
|
-
rules:
|
|
149
|
+
rules: configureModuleRules(helperOptions),
|
|
150
150
|
},
|
|
151
151
|
plugins: configureRspackPlugins(helperOptions),
|
|
152
152
|
optimization: configureRspackOptimization(helperOptions),
|
|
@@ -370,61 +370,6 @@ function configureOutput(options) {
|
|
|
370
370
|
};
|
|
371
371
|
}
|
|
372
372
|
function createJavaScriptLoader({ isEnvProduction, isEnvDevelopment, configType, config, isSsr, }) {
|
|
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');
|
|
378
|
-
return {
|
|
379
|
-
loader: 'builtin:swc-loader',
|
|
380
|
-
options: {
|
|
381
|
-
sourceMaps: !config.disableSourceMapGeneration,
|
|
382
|
-
env: {
|
|
383
|
-
loose: true,
|
|
384
|
-
bugfixes: true,
|
|
385
|
-
targets: browserslist(),
|
|
386
|
-
},
|
|
387
|
-
module: {
|
|
388
|
-
type: 'es6',
|
|
389
|
-
noInterop: true,
|
|
390
|
-
},
|
|
391
|
-
assumptions: {
|
|
392
|
-
setPublicClassFields: true,
|
|
393
|
-
privateFieldsAsProperties: true,
|
|
394
|
-
},
|
|
395
|
-
jsc: {
|
|
396
|
-
parser: {
|
|
397
|
-
syntax: 'typescript',
|
|
398
|
-
tsx: true,
|
|
399
|
-
decorators: true,
|
|
400
|
-
dynamicImport: true,
|
|
401
|
-
},
|
|
402
|
-
transform: {
|
|
403
|
-
react: {
|
|
404
|
-
runtime: config.newJsxTransform ? 'automatic' : 'classic',
|
|
405
|
-
development: isEnvDevelopment,
|
|
406
|
-
refresh: !isSsr && isEnvDevelopment && config.reactRefresh !== false,
|
|
407
|
-
useBuiltIns: true,
|
|
408
|
-
},
|
|
409
|
-
},
|
|
410
|
-
experimental: {
|
|
411
|
-
plugins: !isSsr && isEnvProduction
|
|
412
|
-
? [
|
|
413
|
-
[
|
|
414
|
-
'@swc/plugin-transform-imports',
|
|
415
|
-
{
|
|
416
|
-
lodash: {
|
|
417
|
-
transform: 'lodash/{{member}}',
|
|
418
|
-
},
|
|
419
|
-
},
|
|
420
|
-
],
|
|
421
|
-
]
|
|
422
|
-
: [],
|
|
423
|
-
},
|
|
424
|
-
},
|
|
425
|
-
},
|
|
426
|
-
};
|
|
427
|
-
}
|
|
428
373
|
const plugins = [];
|
|
429
374
|
if (!isSsr) {
|
|
430
375
|
if (isEnvDevelopment && config.reactRefresh !== false) {
|
|
@@ -525,7 +470,7 @@ function createSassStylesRule(options) {
|
|
|
525
470
|
options: {
|
|
526
471
|
sourceMap: true, // must be always true for work with resolve-url-loader
|
|
527
472
|
sassOptions: {
|
|
528
|
-
loadPaths: [paths_1.default.appClient],
|
|
473
|
+
loadPaths: [paths_1.default.app, paths_1.default.appClient],
|
|
529
474
|
},
|
|
530
475
|
},
|
|
531
476
|
},
|
|
@@ -827,7 +772,7 @@ const commonBundlerPlugins = {
|
|
|
827
772
|
rspack: rspack_manifest_plugin_1.RspackManifestPlugin,
|
|
828
773
|
webpack: webpack_manifest_plugin_1.WebpackManifestPlugin,
|
|
829
774
|
},
|
|
830
|
-
|
|
775
|
+
TsCheckerPlugin: {
|
|
831
776
|
rspack: ts_checker_rspack_plugin_1.TsCheckerRspackPlugin,
|
|
832
777
|
webpack: fork_ts_checker_webpack_plugin_1.default,
|
|
833
778
|
},
|
|
@@ -859,7 +804,7 @@ function configureCommonPlugins(options) {
|
|
|
859
804
|
? [new commonBundlerPlugins['ProgressPlugin'][bundler]({ logger: options.logger })]
|
|
860
805
|
: []),
|
|
861
806
|
...(forkTsCheckerOptions
|
|
862
|
-
? [new commonBundlerPlugins['
|
|
807
|
+
? [new commonBundlerPlugins['TsCheckerPlugin'][bundler](forkTsCheckerOptions)]
|
|
863
808
|
: []),
|
|
864
809
|
];
|
|
865
810
|
if (config.detectCircularDependencies) {
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { ManifestPluginOptions } from 'rspack-manifest-plugin';
|
|
2
|
-
import type {
|
|
3
|
-
import type { Configuration, RuleSetRule as RspackRuleSetRule } from '@rspack/core';
|
|
2
|
+
import type { Configuration } from '@rspack/core';
|
|
4
3
|
import type { Logger } from '../logger';
|
|
5
4
|
export declare function clearCacheDirectory(config: Configuration, logger: Logger): void;
|
|
6
5
|
export declare const generateAssetsManifest: ManifestPluginOptions['generate'];
|
|
7
|
-
export declare function prepareRspackRules(webpackRules: (undefined | null | false | '' | 0 | WebpackRuleSetRule | '...')[]): (RspackRuleSetRule | '...')[];
|
|
@@ -28,7 +28,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.generateAssetsManifest = void 0;
|
|
30
30
|
exports.clearCacheDirectory = clearCacheDirectory;
|
|
31
|
-
exports.prepareRspackRules = prepareRspackRules;
|
|
32
31
|
const fs = __importStar(require("node:fs"));
|
|
33
32
|
const path = __importStar(require("node:path"));
|
|
34
33
|
const paths_1 = __importDefault(require("../../common/paths"));
|
|
@@ -69,43 +68,3 @@ const generateAssetsManifest = (seed, files, entries) => {
|
|
|
69
68
|
};
|
|
70
69
|
};
|
|
71
70
|
exports.generateAssetsManifest = generateAssetsManifest;
|
|
72
|
-
function prepareRspackUse(webpackUse) {
|
|
73
|
-
if (typeof webpackUse === 'string') {
|
|
74
|
-
if (webpackUse === 'swc-loader') {
|
|
75
|
-
return 'builtin:swc-loader';
|
|
76
|
-
}
|
|
77
|
-
return webpackUse;
|
|
78
|
-
}
|
|
79
|
-
if (Array.isArray(webpackUse)) {
|
|
80
|
-
for (const item of webpackUse) {
|
|
81
|
-
if (item) {
|
|
82
|
-
prepareRspackUse(item);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
return webpackUse;
|
|
87
|
-
}
|
|
88
|
-
function prepareRspackRules(webpackRules) {
|
|
89
|
-
const rspackRules = [];
|
|
90
|
-
for (const webpackRule of webpackRules) {
|
|
91
|
-
if (!webpackRule) {
|
|
92
|
-
continue;
|
|
93
|
-
}
|
|
94
|
-
if (typeof webpackRule === 'string') {
|
|
95
|
-
rspackRules.push(webpackRule);
|
|
96
|
-
continue;
|
|
97
|
-
}
|
|
98
|
-
const rspackRule = webpackRule;
|
|
99
|
-
if (webpackRule.oneOf) {
|
|
100
|
-
rspackRule.oneOf = prepareRspackRules(webpackRule.oneOf);
|
|
101
|
-
}
|
|
102
|
-
if (webpackRule.rules) {
|
|
103
|
-
rspackRule.rules = prepareRspackRules(webpackRule.rules);
|
|
104
|
-
}
|
|
105
|
-
if (webpackRule.use) {
|
|
106
|
-
rspackRule.use = prepareRspackUse(webpackRule.use);
|
|
107
|
-
}
|
|
108
|
-
rspackRules.push(rspackRule);
|
|
109
|
-
}
|
|
110
|
-
return rspackRules;
|
|
111
|
-
}
|
|
@@ -11,7 +11,7 @@ export declare function configureWebpackConfigForStorybook(mode: Mode, userConfi
|
|
|
11
11
|
resolve: Webpack.ResolveOptions;
|
|
12
12
|
plugins: (false | "" | 0 | ((this: Webpack.Compiler, compiler: Webpack.Compiler) => void) | Webpack.WebpackPluginInstance | null | undefined)[];
|
|
13
13
|
optimization: {
|
|
14
|
-
minimizer: (false | "" | 0 | "..." |
|
|
14
|
+
minimizer: (false | "" | 0 | Webpack.WebpackPluginInstance | "..." | ((this: Webpack.Compiler, compiler: Webpack.Compiler) => void) | null | undefined)[] | undefined;
|
|
15
15
|
};
|
|
16
16
|
}>;
|
|
17
17
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gravity-ui/app-builder",
|
|
3
|
-
"version": "0.15.1-beta.
|
|
3
|
+
"version": "0.15.1-beta.7",
|
|
4
4
|
"description": "Develop and build your React client-server projects, powered by typescript and webpack",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -79,7 +79,6 @@
|
|
|
79
79
|
"@svgr/core": "^8.1.0",
|
|
80
80
|
"@svgr/plugin-jsx": "^8.1.0",
|
|
81
81
|
"@svgr/webpack": "^8.1.0",
|
|
82
|
-
"@swc/plugin-transform-imports": "^6.1.0",
|
|
83
82
|
"babel-loader": "^9.2.1",
|
|
84
83
|
"babel-plugin-import": "^1.13.8",
|
|
85
84
|
"babel-plugin-inline-react-svg": "^2.0.2",
|