arui-scripts 14.4.0 → 14.5.0-feat-modules.1
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 +23 -0
- package/README.md +1 -0
- package/build/bin/index.js +1 -0
- package/build/commands/build/build-wrapper.d.ts +2 -2
- package/build/commands/build/client.js +3 -3
- package/build/commands/build/index.js +5 -30
- package/build/commands/bundle-analyze/index.js +5 -7
- package/build/commands/changelog/index.js +2 -2
- package/build/commands/docker-build/index.js +1 -3
- package/build/commands/docker-build-compiled/index.js +1 -3
- package/build/commands/start/client.js +2 -30
- package/build/commands/start/index.js +5 -27
- package/build/commands/start/server.js +2 -11
- package/build/commands/start-prod/client.d.ts +1 -0
- package/build/commands/start-prod/client.js +8 -0
- package/build/commands/start-prod/index.d.ts +1 -0
- package/build/commands/start-prod/index.js +8 -0
- package/build/commands/start-prod/server.d.ts +1 -0
- package/build/commands/start-prod/server.js +8 -0
- package/build/commands/util/docker-build.d.ts +6 -0
- package/build/commands/util/docker-build.js +19 -1
- package/build/commands/util/run-client-dev-derver.d.ts +2 -0
- package/build/commands/util/run-client-dev-derver.js +47 -0
- package/build/commands/util/run-compilers.d.ts +1 -0
- package/build/commands/util/run-compilers.js +31 -0
- package/build/commands/util/run-server-watch-compiler.d.ts +2 -0
- package/build/commands/util/run-server-watch-compiler.js +21 -0
- package/build/configs/app-configs/calculate-dependent-config.d.ts +48 -8
- package/build/configs/app-configs/calculate-dependent-config.js +11 -13
- package/build/configs/app-configs/get-defaults.d.ts +3 -2
- package/build/configs/app-configs/get-defaults.js +49 -34
- package/build/configs/app-configs/index.d.ts +5 -3
- package/build/configs/app-configs/index.js +13 -7
- package/build/configs/app-configs/types.d.ts +60 -26
- package/build/configs/app-configs/update-with-config-file.d.ts +2 -2
- package/build/configs/app-configs/update-with-config-file.js +5 -7
- package/build/configs/app-configs/update-with-env.js +3 -8
- package/build/configs/app-configs/update-with-package.d.ts +2 -2
- package/build/configs/app-configs/update-with-package.js +5 -10
- package/build/configs/app-configs/update-with-presets.d.ts +2 -2
- package/build/configs/app-configs/update-with-presets.js +8 -15
- package/build/configs/app-configs/validate-settings-keys.d.ts +2 -5
- package/build/configs/app-configs/validate-settings-keys.js +6 -7
- package/build/configs/babel-client.d.ts +33 -1
- package/build/configs/babel-dependencies.d.ts +14 -1
- package/build/configs/babel-server.d.ts +26 -1
- package/build/configs/dev-server.d.ts +15 -2
- package/build/configs/jest/index.d.ts +33 -1
- package/build/configs/modules.d.ts +15 -0
- package/build/configs/modules.js +78 -0
- package/build/configs/server-externals-exemptions.d.ts +1 -1
- package/build/configs/server-externals-exemptions.js +1 -0
- package/build/configs/util/apply-overrides.d.ts +6 -6
- package/build/configs/util/get-entry.d.ts +2 -1
- package/build/configs/webpack.client.d.ts +5 -2
- package/build/configs/webpack.client.dev.d.ts +1 -1
- package/build/configs/webpack.client.js +71 -17
- package/build/configs/webpack.client.prod.d.ts +1 -1
- package/build/index.d.ts +2 -1
- package/build/index.js +3 -1
- package/build/tsconfig-local.tsbuildinfo +1 -1
- package/docs/modules.md +423 -0
- package/package.json +5 -2
- package/build/configs/app-configs/available-package-settings.d.ts +0 -8
- package/build/configs/app-configs/available-package-settings.js +0 -32
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getExposeLoadersFormEmbeddedModules = exports.getChunkNamePrefix = exports.getCssPrefixForModule = exports.haveExposedMfModules = exports.processAssetsPluginOutput = void 0;
|
|
7
|
+
const app_configs_1 = __importDefault(require("./app-configs"));
|
|
8
|
+
function processAssetsPluginOutput(assets) {
|
|
9
|
+
var _a;
|
|
10
|
+
let adjustedAssets = assets;
|
|
11
|
+
if (haveExposedMfModules()) { // для mf модулей мы делаем publicPath 'auto', но в самом манифесте нам все равно хочется видеть нормальный путь
|
|
12
|
+
Object.keys(adjustedAssets).forEach((key) => {
|
|
13
|
+
adjustedAssets[key] = {
|
|
14
|
+
css: replaceAutoPath(adjustedAssets[key].css),
|
|
15
|
+
js: replaceAutoPath(adjustedAssets[key].js),
|
|
16
|
+
};
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
const result = Object.assign(Object.assign({}, adjustedAssets), { __metadata__: {
|
|
20
|
+
version: app_configs_1.default.version,
|
|
21
|
+
name: ((_a = app_configs_1.default.mfModules) === null || _a === void 0 ? void 0 : _a.name) || app_configs_1.default.normalizedName,
|
|
22
|
+
} });
|
|
23
|
+
return JSON.stringify(result);
|
|
24
|
+
}
|
|
25
|
+
exports.processAssetsPluginOutput = processAssetsPluginOutput;
|
|
26
|
+
function replaceAutoPath(assets) {
|
|
27
|
+
if (!assets) {
|
|
28
|
+
return assets;
|
|
29
|
+
}
|
|
30
|
+
if (Array.isArray(assets)) {
|
|
31
|
+
return assets.map((asset) => asset.replace(/^auto\//, app_configs_1.default.publicPath));
|
|
32
|
+
}
|
|
33
|
+
return assets.replace(/^auto\//, app_configs_1.default.publicPath);
|
|
34
|
+
}
|
|
35
|
+
function haveExposedMfModules() {
|
|
36
|
+
var _a;
|
|
37
|
+
return (_a = app_configs_1.default.mfModules) === null || _a === void 0 ? void 0 : _a.exposes;
|
|
38
|
+
}
|
|
39
|
+
exports.haveExposedMfModules = haveExposedMfModules;
|
|
40
|
+
function getCssPrefixForModule(module) {
|
|
41
|
+
if (module.cssPrefix) {
|
|
42
|
+
return module.cssPrefix;
|
|
43
|
+
}
|
|
44
|
+
if (module.cssPrefix === false) {
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
47
|
+
return `.module-${module.name}`;
|
|
48
|
+
}
|
|
49
|
+
exports.getCssPrefixForModule = getCssPrefixForModule;
|
|
50
|
+
function getChunkNamePrefix(module) {
|
|
51
|
+
if (!module) {
|
|
52
|
+
return '';
|
|
53
|
+
}
|
|
54
|
+
return `${module.name}-`;
|
|
55
|
+
}
|
|
56
|
+
exports.getChunkNamePrefix = getChunkNamePrefix;
|
|
57
|
+
function getExposeLoadersFormEmbeddedModules(module) {
|
|
58
|
+
var _a;
|
|
59
|
+
const shared = (_a = app_configs_1.default.embeddedModules) === null || _a === void 0 ? void 0 : _a.shared;
|
|
60
|
+
if (!shared || module) {
|
|
61
|
+
return [];
|
|
62
|
+
}
|
|
63
|
+
return Object.keys(shared).map((libraryName) => {
|
|
64
|
+
const globalVarName = shared[libraryName];
|
|
65
|
+
return {
|
|
66
|
+
test: require.resolve(libraryName),
|
|
67
|
+
use: [
|
|
68
|
+
{
|
|
69
|
+
loader: require.resolve('expose-loader'),
|
|
70
|
+
options: {
|
|
71
|
+
exposes: [globalVarName],
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
};
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
exports.getExposeLoadersFormEmbeddedModules = getExposeLoadersFormEmbeddedModules;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const serverExternalsExemptions:
|
|
1
|
+
export declare const serverExternalsExemptions: RegExp[];
|
|
@@ -2,14 +2,14 @@ import type { Configuration as WebpackConfiguration, WebpackOptionsNormalized }
|
|
|
2
2
|
import type { Configuration as WebpackDevServerConfiguration } from 'webpack-dev-server';
|
|
3
3
|
import { AppConfigs } from '../app-configs/types';
|
|
4
4
|
type Overrides = {
|
|
5
|
-
webpack: WebpackConfiguration;
|
|
6
|
-
webpackClient: WebpackConfiguration;
|
|
7
|
-
webpackDev: WebpackConfiguration;
|
|
8
|
-
webpackClientDev: WebpackConfiguration;
|
|
5
|
+
webpack: WebpackConfiguration | WebpackConfiguration[];
|
|
6
|
+
webpackClient: WebpackConfiguration | WebpackConfiguration[];
|
|
7
|
+
webpackDev: WebpackConfiguration | WebpackConfiguration[];
|
|
8
|
+
webpackClientDev: WebpackConfiguration | WebpackConfiguration[];
|
|
9
9
|
webpackServer: WebpackConfiguration;
|
|
10
10
|
webpackServerDev: WebpackConfiguration;
|
|
11
11
|
webpackProd: WebpackConfiguration;
|
|
12
|
-
webpackClientProd: WebpackConfiguration;
|
|
12
|
+
webpackClientProd: WebpackConfiguration | WebpackConfiguration[];
|
|
13
13
|
webpackServerProd: WebpackConfiguration;
|
|
14
14
|
devServer: WebpackDevServerConfiguration;
|
|
15
15
|
stats: WebpackOptionsNormalized['stats'];
|
|
@@ -36,5 +36,5 @@ export type OverrideFile = {
|
|
|
36
36
|
* @param {Object} config Конфиг, к которому нужно применить оверрайды
|
|
37
37
|
* @returns {*}
|
|
38
38
|
*/
|
|
39
|
-
declare function applyOverrides<Key extends keyof Overrides>(overridesKey: Key | Key[], config:
|
|
39
|
+
declare function applyOverrides<T extends Overrides[Key], Key extends keyof Overrides>(overridesKey: Key | Key[], config: T): T;
|
|
40
40
|
export default applyOverrides;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
export type Entry = string | string[] | Record<string, string | string[]>;
|
|
1
2
|
/**
|
|
2
3
|
* @param {string|string[]|object} entryPoint Строка, массив строк или объект с энтрипоинтами
|
|
3
4
|
* @param {Function} getSingleEntry Функция, возвращающая конфигурацию для одного entryPoint
|
|
4
5
|
* @param args Дополнительные аргументы, которые будут переданы в getSingleEntry функцию
|
|
5
6
|
* @returns {*}
|
|
6
7
|
*/
|
|
7
|
-
declare function getEntry<AdditionalArgs extends unknown[]>(entryPoint:
|
|
8
|
+
declare function getEntry<AdditionalArgs extends unknown[]>(entryPoint: Entry, getSingleEntry: (entry: string[], ...args: AdditionalArgs) => string[], ...args: AdditionalArgs): string[] | Record<string, string | string[]>;
|
|
8
9
|
export default getEntry;
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
import { Configuration } from 'webpack';
|
|
2
|
-
|
|
1
|
+
import webpack, { Configuration } from 'webpack';
|
|
2
|
+
import { Entry } from './util/get-entry';
|
|
3
|
+
import { EmbeddedModuleConfig } from './app-configs/types';
|
|
4
|
+
export declare const createSingleClientWebpackConfig: (mode: 'dev' | 'prod', entry: Entry, module?: EmbeddedModuleConfig) => Configuration;
|
|
5
|
+
export declare const createClientWebpackConfig: (mode: 'dev' | 'prod') => webpack.Configuration | webpack.Configuration[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const config: import("webpack").Configuration;
|
|
1
|
+
declare const config: import("webpack").Configuration | import("webpack").Configuration[];
|
|
2
2
|
export default config;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.createClientWebpackConfig = void 0;
|
|
6
|
+
exports.createClientWebpackConfig = exports.createSingleClientWebpackConfig = void 0;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
8
|
const webpack_1 = __importDefault(require("webpack"));
|
|
9
9
|
const webpack_manifest_plugin_1 = require("webpack-manifest-plugin");
|
|
@@ -14,7 +14,7 @@ const compression_webpack_plugin_1 = __importDefault(require("compression-webpac
|
|
|
14
14
|
const assets_webpack_plugin_1 = __importDefault(require("assets-webpack-plugin"));
|
|
15
15
|
const tsconfig_paths_webpack_plugin_1 = __importDefault(require("tsconfig-paths-webpack-plugin"));
|
|
16
16
|
const getCSSModuleLocalIdent_1 = __importDefault(require("react-dev-utils/getCSSModuleLocalIdent"));
|
|
17
|
-
const
|
|
17
|
+
const postcss_prefix_selector_1 = __importDefault(require("postcss-prefix-selector"));
|
|
18
18
|
const get_entry_1 = __importDefault(require("./util/get-entry"));
|
|
19
19
|
const app_configs_1 = __importDefault(require("./app-configs"));
|
|
20
20
|
const babel_client_1 = __importDefault(require("./babel-client"));
|
|
@@ -24,21 +24,32 @@ const babel_dependencies_1 = require("./babel-dependencies");
|
|
|
24
24
|
const react_refresh_typescript_1 = __importDefault(require("react-refresh-typescript"));
|
|
25
25
|
const react_refresh_webpack_plugin_1 = __importDefault(require("@pmmmwh/react-refresh-webpack-plugin"));
|
|
26
26
|
const case_sensitive_paths_webpack_plugin_1 = __importDefault(require("case-sensitive-paths-webpack-plugin"));
|
|
27
|
+
const modules_1 = require("./modules");
|
|
28
|
+
const PnpWebpackPlugin = require('pnp-webpack-plugin');
|
|
27
29
|
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
|
|
28
30
|
const noopPath = require.resolve('./util/noop');
|
|
29
31
|
function getSingleEntry(entryPoint, mode) {
|
|
30
32
|
return [
|
|
31
33
|
...(Array.isArray(app_configs_1.default.clientPolyfillsEntry) ? app_configs_1.default.clientPolyfillsEntry : [app_configs_1.default.clientPolyfillsEntry]),
|
|
32
|
-
mode === 'dev' ? require.resolve('webpack/hot/dev-server') : false,
|
|
33
34
|
...entryPoint
|
|
34
35
|
].filter(Boolean);
|
|
35
36
|
}
|
|
36
|
-
//
|
|
37
|
-
const
|
|
37
|
+
// Нам важно шарить assets plugin между разными сборками, чтобы файл не перезаписывался
|
|
38
|
+
const assetsPlugin = new assets_webpack_plugin_1.default({
|
|
39
|
+
path: app_configs_1.default.serverOutputPath,
|
|
40
|
+
processOutput: modules_1.processAssetsPluginOutput,
|
|
41
|
+
});
|
|
42
|
+
// Этот плагин нужен для того, чтобы клиентский код так же могу получить информацию о сборке.
|
|
43
|
+
// Это позволяет нам делать виджеты, работающие только на клиенте
|
|
44
|
+
const clientAssetsPlugin = new assets_webpack_plugin_1.default({
|
|
45
|
+
path: app_configs_1.default.clientOutputPath,
|
|
46
|
+
processOutput: modules_1.processAssetsPluginOutput,
|
|
47
|
+
});
|
|
48
|
+
const createSingleClientWebpackConfig = (mode, entry, module) => ({
|
|
38
49
|
target: 'web',
|
|
39
50
|
mode: mode === 'dev' ? 'development' : 'production',
|
|
40
51
|
devtool: mode === 'dev' ? app_configs_1.default.devSourceMaps : 'source-map',
|
|
41
|
-
entry: (0, get_entry_1.default)(
|
|
52
|
+
entry: (0, get_entry_1.default)(entry, getSingleEntry, mode),
|
|
42
53
|
// in production mode we need to fail on first error
|
|
43
54
|
bail: mode === 'prod',
|
|
44
55
|
context: app_configs_1.default.cwd,
|
|
@@ -46,14 +57,21 @@ const createClientWebpackConfig = (mode) => ({
|
|
|
46
57
|
// Add /* filename */ comments to generated require()s in the output.
|
|
47
58
|
pathinfo: mode === 'dev',
|
|
48
59
|
path: app_configs_1.default.clientOutputPath,
|
|
49
|
-
publicPath:
|
|
60
|
+
publicPath: (0, modules_1.haveExposedMfModules)()
|
|
61
|
+
? 'auto' // Для того чтобы модули могли подключаться из разных мест, нам необходимо использовать auto. Для корректной работы в IE надо подключaть https://github.com/amiller-gh/currentScript-polyfill
|
|
62
|
+
: app_configs_1.default.publicPath,
|
|
50
63
|
filename: mode === 'dev' ? '[name].js' : '[name].[chunkhash:8].js',
|
|
51
|
-
chunkFilename: mode === 'dev'
|
|
64
|
+
chunkFilename: mode === 'dev'
|
|
65
|
+
? `${(0, modules_1.getChunkNamePrefix)(module)}[name].js`
|
|
66
|
+
: `${(0, modules_1.getChunkNamePrefix)(module)}[name].[chunkhash:8].chunk.js`,
|
|
52
67
|
// Point sourcemap entries to original disk location (format as URL on Windows)
|
|
53
68
|
devtoolModuleFilenameTemplate: (info) => path_1.default
|
|
54
69
|
.relative(app_configs_1.default.appSrc, info.absoluteResourcePath)
|
|
55
70
|
.replace(/\\/g, '/'),
|
|
71
|
+
// для модулей нам надо переопределять глобальную переменную webpack, чтобы несколько модулей из одного бандла могли работать в одном окружении
|
|
72
|
+
uniqueName: module ? module.name : undefined
|
|
56
73
|
},
|
|
74
|
+
externals: Object.assign({}, ((module === null || module === void 0 ? void 0 : module.embeddedConfig) ? module.embeddedConfig : {})),
|
|
57
75
|
optimization: {
|
|
58
76
|
splitChunks: mode === 'prod'
|
|
59
77
|
? {
|
|
@@ -68,7 +86,14 @@ const createClientWebpackConfig = (mode) => ({
|
|
|
68
86
|
vendor: {
|
|
69
87
|
test: /node_modules/,
|
|
70
88
|
chunks: "initial",
|
|
71
|
-
name:
|
|
89
|
+
name: (_, chunks, cacheGroupKey) => {
|
|
90
|
+
if (!module) {
|
|
91
|
+
return 'vendor';
|
|
92
|
+
}
|
|
93
|
+
// Нам нужно сделать так, чтобы у модулей vendor файл назывался иначе, чем просто vendor
|
|
94
|
+
const allChunksNames = chunks.map((item) => item.name).join('~');
|
|
95
|
+
return `${cacheGroupKey}-${allChunksNames}`;
|
|
96
|
+
},
|
|
72
97
|
priority: 10,
|
|
73
98
|
enforce: true
|
|
74
99
|
}
|
|
@@ -161,6 +186,7 @@ const createClientWebpackConfig = (mode) => ({
|
|
|
161
186
|
// see https://github.com/webpack/webpack/issues/7378
|
|
162
187
|
strictExportPresence: !app_configs_1.default.tsconfig,
|
|
163
188
|
rules: [
|
|
189
|
+
...(0, modules_1.getExposeLoadersFormEmbeddedModules)(module),
|
|
164
190
|
{
|
|
165
191
|
// "oneOf" will traverse all following loaders until one will
|
|
166
192
|
// match the requirements. When no loader matches it will fall
|
|
@@ -251,7 +277,11 @@ const createClientWebpackConfig = (mode) => ({
|
|
|
251
277
|
// Necessary for external CSS imports to work
|
|
252
278
|
// https://github.com/facebookincubator/create-react-app/issues/2677
|
|
253
279
|
ident: 'postcss',
|
|
254
|
-
plugins: () =>
|
|
280
|
+
plugins: () => {
|
|
281
|
+
const prefix = module ? (0, modules_1.getCssPrefixForModule)(module) : undefined;
|
|
282
|
+
return [...postcss_1.default]
|
|
283
|
+
.concat(prefix ? (0, postcss_prefix_selector_1.default)({ prefix }) : []);
|
|
284
|
+
},
|
|
255
285
|
},
|
|
256
286
|
},
|
|
257
287
|
],
|
|
@@ -280,7 +310,11 @@ const createClientWebpackConfig = (mode) => ({
|
|
|
280
310
|
// Necessary for external CSS imports to work
|
|
281
311
|
// https://github.com/facebookincubator/create-react-app/issues/2677
|
|
282
312
|
ident: 'postcss',
|
|
283
|
-
plugins: () =>
|
|
313
|
+
plugins: () => {
|
|
314
|
+
const prefix = module ? (0, modules_1.getCssPrefixForModule)(module) : undefined;
|
|
315
|
+
return [...postcss_1.default]
|
|
316
|
+
.concat(prefix ? (0, postcss_prefix_selector_1.default)({ prefix: `:global(${prefix})` }) : []);
|
|
317
|
+
},
|
|
284
318
|
},
|
|
285
319
|
},
|
|
286
320
|
],
|
|
@@ -308,7 +342,8 @@ const createClientWebpackConfig = (mode) => ({
|
|
|
308
342
|
],
|
|
309
343
|
},
|
|
310
344
|
plugins: ([
|
|
311
|
-
|
|
345
|
+
assetsPlugin,
|
|
346
|
+
clientAssetsPlugin,
|
|
312
347
|
new webpack_1.default.DefinePlugin(Object.assign({
|
|
313
348
|
// Tell Webpack to provide empty mocks for process.env.
|
|
314
349
|
'process.env': '{}' }, (mode === 'dev'
|
|
@@ -349,7 +384,13 @@ const createClientWebpackConfig = (mode) => ({
|
|
|
349
384
|
// Ignore prop-types packages in production mode
|
|
350
385
|
// This should works fine, since proptypes usage should be eliminated in production mode
|
|
351
386
|
mode === 'prod' && !app_configs_1.default.keepPropTypes && new webpack_1.default.NormalModuleReplacementPlugin(/^react-style-proptype$/, noopPath),
|
|
352
|
-
mode === 'prod' && !app_configs_1.default.keepPropTypes && new webpack_1.default.NormalModuleReplacementPlugin(/^thrift-services\/proptypes/, noopPath)
|
|
387
|
+
mode === 'prod' && !app_configs_1.default.keepPropTypes && new webpack_1.default.NormalModuleReplacementPlugin(/^thrift-services\/proptypes/, noopPath),
|
|
388
|
+
app_configs_1.default.mfModules && !module && new webpack_1.default.container.ModuleFederationPlugin({
|
|
389
|
+
name: app_configs_1.default.mfModules.name || app_configs_1.default.normalizedName,
|
|
390
|
+
filename: app_configs_1.default.mfModules.exposes ? 'remoteEntry.js' : undefined,
|
|
391
|
+
shared: app_configs_1.default.mfModules.shared,
|
|
392
|
+
exposes: app_configs_1.default.mfModules.exposes,
|
|
393
|
+
}),
|
|
353
394
|
].filter(Boolean)),
|
|
354
395
|
experiments: {
|
|
355
396
|
backCompat: app_configs_1.default.webpack4Compatibility,
|
|
@@ -359,11 +400,24 @@ const createClientWebpackConfig = (mode) => ({
|
|
|
359
400
|
ignored: new RegExp(app_configs_1.default.watchIgnorePath.join('|')),
|
|
360
401
|
aggregateTimeout: 100,
|
|
361
402
|
},
|
|
362
|
-
//
|
|
363
|
-
// splitting or minification in interest of speed. These warnings become
|
|
364
|
-
// cumbersome.
|
|
403
|
+
// Выключаем performance hints, т.к. размеры бандлов контролируются не в рамках arui-scripts
|
|
365
404
|
performance: {
|
|
366
|
-
hints:
|
|
405
|
+
hints: false,
|
|
367
406
|
},
|
|
368
407
|
});
|
|
408
|
+
exports.createSingleClientWebpackConfig = createSingleClientWebpackConfig;
|
|
409
|
+
const createClientWebpackConfig = (mode) => {
|
|
410
|
+
var _a;
|
|
411
|
+
const appWebpackConfig = (0, exports.createSingleClientWebpackConfig)(mode, app_configs_1.default.clientEntry);
|
|
412
|
+
const exposedModules = (_a = app_configs_1.default.embeddedModules) === null || _a === void 0 ? void 0 : _a.exposes;
|
|
413
|
+
if (!exposedModules || Object.keys(exposedModules).length === 0) {
|
|
414
|
+
return appWebpackConfig;
|
|
415
|
+
}
|
|
416
|
+
const modulesWebpackConfigs = Object.keys(exposedModules).map((moduleId) => {
|
|
417
|
+
return (0, exports.createSingleClientWebpackConfig)(mode, {
|
|
418
|
+
[moduleId]: exposedModules[moduleId].entry,
|
|
419
|
+
}, Object.assign({ name: moduleId }, exposedModules[moduleId]));
|
|
420
|
+
});
|
|
421
|
+
return [appWebpackConfig, ...modulesWebpackConfigs];
|
|
422
|
+
};
|
|
369
423
|
exports.createClientWebpackConfig = createClientWebpackConfig;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const config: import("webpack").Configuration;
|
|
1
|
+
declare const config: import("webpack").Configuration | import("webpack").Configuration[];
|
|
2
2
|
export default config;
|
package/build/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export type { OverrideFile } from './configs/util/apply-overrides';
|
|
2
|
-
export type { PackageSettings } from './configs/app-configs/
|
|
2
|
+
export type { AppConfigs, PackageSettings } from './configs/app-configs/types';
|
|
3
3
|
export { prepareFilesForDocker } from './commands/util/docker-build';
|
|
4
4
|
export { getBuildParamsFromArgs } from './commands/util/docker-build';
|
|
5
|
+
export { getDockerBuildCommand } from './commands/util/docker-build';
|
package/build/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getBuildParamsFromArgs = exports.prepareFilesForDocker = void 0;
|
|
3
|
+
exports.getDockerBuildCommand = exports.getBuildParamsFromArgs = exports.prepareFilesForDocker = void 0;
|
|
4
4
|
var docker_build_1 = require("./commands/util/docker-build");
|
|
5
5
|
Object.defineProperty(exports, "prepareFilesForDocker", { enumerable: true, get: function () { return docker_build_1.prepareFilesForDocker; } });
|
|
6
6
|
var docker_build_2 = require("./commands/util/docker-build");
|
|
7
7
|
Object.defineProperty(exports, "getBuildParamsFromArgs", { enumerable: true, get: function () { return docker_build_2.getBuildParamsFromArgs; } });
|
|
8
|
+
var docker_build_3 = require("./commands/util/docker-build");
|
|
9
|
+
Object.defineProperty(exports, "getDockerBuildCommand", { enumerable: true, get: function () { return docker_build_3.getDockerBuildCommand; } });
|