@gravity-ui/app-builder 0.15.1-beta.5 → 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.
|
@@ -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,53 +370,6 @@ function configureOutput(options) {
|
|
|
370
370
|
};
|
|
371
371
|
}
|
|
372
372
|
function createJavaScriptLoader({ isEnvProduction, isEnvDevelopment, configType, config, isSsr, }) {
|
|
373
|
-
if (config.codeLoader === 'swc') {
|
|
374
|
-
return {
|
|
375
|
-
loader: 'builtin:swc-loader',
|
|
376
|
-
options: {
|
|
377
|
-
sourceMaps: !config.disableSourceMapGeneration,
|
|
378
|
-
env: {
|
|
379
|
-
loose: true,
|
|
380
|
-
bugfixes: true,
|
|
381
|
-
},
|
|
382
|
-
module: {
|
|
383
|
-
type: 'es6',
|
|
384
|
-
},
|
|
385
|
-
assumptions: {
|
|
386
|
-
setPublicClassFields: true,
|
|
387
|
-
privateFieldsAsProperties: true,
|
|
388
|
-
},
|
|
389
|
-
jsc: {
|
|
390
|
-
parser: {
|
|
391
|
-
syntax: 'typescript',
|
|
392
|
-
tsx: true,
|
|
393
|
-
},
|
|
394
|
-
transform: {
|
|
395
|
-
react: {
|
|
396
|
-
runtime: config.newJsxTransform ? 'automatic' : 'classic',
|
|
397
|
-
development: isEnvDevelopment,
|
|
398
|
-
refresh: !isSsr && isEnvDevelopment && config.reactRefresh !== false,
|
|
399
|
-
useBuiltIns: true,
|
|
400
|
-
},
|
|
401
|
-
},
|
|
402
|
-
experimental: {
|
|
403
|
-
plugins: !isSsr && isEnvProduction
|
|
404
|
-
? [
|
|
405
|
-
[
|
|
406
|
-
'@swc/plugin-transform-imports',
|
|
407
|
-
{
|
|
408
|
-
lodash: {
|
|
409
|
-
transform: 'lodash/{{member}}',
|
|
410
|
-
},
|
|
411
|
-
},
|
|
412
|
-
],
|
|
413
|
-
]
|
|
414
|
-
: [],
|
|
415
|
-
},
|
|
416
|
-
},
|
|
417
|
-
},
|
|
418
|
-
};
|
|
419
|
-
}
|
|
420
373
|
const plugins = [];
|
|
421
374
|
if (!isSsr) {
|
|
422
375
|
if (isEnvDevelopment && config.reactRefresh !== false) {
|
|
@@ -517,7 +470,7 @@ function createSassStylesRule(options) {
|
|
|
517
470
|
options: {
|
|
518
471
|
sourceMap: true, // must be always true for work with resolve-url-loader
|
|
519
472
|
sassOptions: {
|
|
520
|
-
loadPaths: [paths_1.default.appClient],
|
|
473
|
+
loadPaths: [paths_1.default.app, paths_1.default.appClient],
|
|
521
474
|
},
|
|
522
475
|
},
|
|
523
476
|
},
|
|
@@ -819,7 +772,7 @@ const commonBundlerPlugins = {
|
|
|
819
772
|
rspack: rspack_manifest_plugin_1.RspackManifestPlugin,
|
|
820
773
|
webpack: webpack_manifest_plugin_1.WebpackManifestPlugin,
|
|
821
774
|
},
|
|
822
|
-
|
|
775
|
+
TsCheckerPlugin: {
|
|
823
776
|
rspack: ts_checker_rspack_plugin_1.TsCheckerRspackPlugin,
|
|
824
777
|
webpack: fork_ts_checker_webpack_plugin_1.default,
|
|
825
778
|
},
|
|
@@ -851,7 +804,7 @@ function configureCommonPlugins(options) {
|
|
|
851
804
|
? [new commonBundlerPlugins['ProgressPlugin'][bundler]({ logger: options.logger })]
|
|
852
805
|
: []),
|
|
853
806
|
...(forkTsCheckerOptions
|
|
854
|
-
? [new commonBundlerPlugins['
|
|
807
|
+
? [new commonBundlerPlugins['TsCheckerPlugin'][bundler](forkTsCheckerOptions)]
|
|
855
808
|
: []),
|
|
856
809
|
];
|
|
857
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",
|