arui-scripts 20.5.1 → 20.6.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/.turbo/turbo-test.log +5 -5
- package/CHANGELOG.md +14 -0
- package/build/configs/app-configs/get-defaults.js +1 -0
- package/build/configs/app-configs/index.js +2 -0
- package/build/configs/app-configs/types.d.ts +5 -1
- package/build/configs/app-configs/validate-config.d.ts +2 -0
- package/build/configs/app-configs/validate-config.js +8 -0
- package/build/configs/modules.d.ts +1 -1
- package/build/configs/modules.js +15 -9
- package/build/configs/webpack.client.js +68 -23
- package/build/configs/webpack.server.js +54 -17
- package/build/templates/start.template.js +1 -1
- package/build/tsconfig-local.tsbuildinfo +1 -1
- package/docs/modules.md +68 -28
- package/docs/settings.md +19 -0
- package/package.json +2 -1
package/.turbo/turbo-test.log
CHANGED
|
@@ -5,20 +5,20 @@ ts-jest[versions] (WARN) Version 29.7.0 of jest installed has not been tested wi
|
|
|
5
5
|
ts-jest[versions] (WARN) Version 5.6.3 of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=4.3.0 <5.0.0-0). Please do not report issues in ts-jest if you are using unsupported versions.
|
|
6
6
|
ts-jest[versions] (WARN) Version 5.6.3 of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=4.3.0 <5.0.0-0). Please do not report issues in ts-jest if you are using unsupported versions.
|
|
7
7
|
ts-jest[versions] (WARN) Version 5.6.3 of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=4.3.0 <5.0.0-0). Please do not report issues in ts-jest if you are using unsupported versions.
|
|
8
|
-
PASS src/
|
|
8
|
+
PASS src/plugins/postcss-global-variables/utils/__tests__/add-global-variable.tests.ts (29.372 s)
|
|
9
9
|
PASS src/configs/util/__tests__/apply-overrides.tests.ts
|
|
10
|
-
PASS src/plugins/postcss-global-variables/utils/__tests__/add-global-variable.tests.ts (28.742 s)
|
|
11
10
|
PASS src/configs/app-configs/__tests__/update-with-env.tests.ts
|
|
12
11
|
PASS src/configs/app-configs/__tests__/update-with-package.tests.ts
|
|
13
12
|
PASS src/configs/util/__tests__/compress-with-dcb.test.ts
|
|
13
|
+
PASS src/configs/app-configs/__tests__/update-with-presets.tests.ts (30.134 s)
|
|
14
14
|
PASS src/configs/util/__tests__/get-polyfills.tests.ts
|
|
15
|
-
PASS src/plugins/postcss-global-variables/utils/__tests__/parse-variables.tests.ts
|
|
16
15
|
PASS src/plugins/postcss-global-variables/utils/__tests__/get-media-query-name.tests.ts
|
|
17
16
|
PASS src/configs/app-configs/__tests__/validate-settings-keys.tests.ts
|
|
18
|
-
PASS src/
|
|
17
|
+
PASS src/plugins/postcss-global-variables/utils/__tests__/parse-variables.tests.ts
|
|
18
|
+
PASS src/configs/util/__tests__/find-plugin.tests.ts (32.384 s)
|
|
19
19
|
|
|
20
20
|
Test Suites: 11 passed, 11 total
|
|
21
21
|
Tests: 25 passed, 25 total
|
|
22
22
|
Snapshots: 0 total
|
|
23
|
-
Time:
|
|
23
|
+
Time: 33.462 s
|
|
24
24
|
Ran all test suites.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# [15.3.0](https://github.com/core-ds/arui-scripts/compare/v15.2.0...v15.3.0) (2023-06-30)
|
|
2
2
|
|
|
3
|
+
## 20.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#374](https://github.com/core-ds/arui-scripts/pull/374) [`e1de841`](https://github.com/core-ds/arui-scripts/commit/e1de841b5c19242801416ba8fb3acf9c7721f481) Thanks [@heymdall-legal](https://github.com/heymdall-legal)! - Добавлена экспериментальная поддержка [react-compiler](https://react.dev/learn/react-compiler/introduction).
|
|
8
|
+
|
|
9
|
+
На данный момент **не рекомендуется** использовать её в production проектах.
|
|
10
|
+
|
|
11
|
+
- [#384](https://github.com/core-ds/arui-scripts/pull/384) [`64d8412`](https://github.com/core-ds/arui-scripts/commit/64d8412c262a15299cb901501a39100ca78902a9) Thanks [@heymdall-legal](https://github.com/heymdall-legal)! - Добавлена возможность создавать отдельную сборку для wmf модулей для применения css префиксов только к коду модулей
|
|
12
|
+
|
|
13
|
+
- [#382](https://github.com/core-ds/arui-scripts/pull/382) [`fb0a02e`](https://github.com/core-ds/arui-scripts/commit/fb0a02ea68d60b1c67ecda72dc4a200c5c91ad23) Thanks [@qrik116](https://github.com/qrik116)! - Добавлена команда `exec` для запуска `node` приложения, чтобы приложение могло получать `signals` от операционной системы
|
|
14
|
+
|
|
15
|
+
В частности сигнал завершении работы `SIGTERM`, чтобы была возможность корректно завершить работу приложения и выполнить отключение от баз данных и других ресурсов
|
|
16
|
+
|
|
3
17
|
## 20.5.1
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -7,6 +7,7 @@ const update_with_config_file_1 = require("./update-with-config-file");
|
|
|
7
7
|
const update_with_env_1 = require("./update-with-env");
|
|
8
8
|
const update_with_package_1 = require("./update-with-package");
|
|
9
9
|
const update_with_presets_1 = require("./update-with-presets");
|
|
10
|
+
const validate_config_1 = require("./validate-config");
|
|
10
11
|
const warn_about_deprecations_1 = require("./warn-about-deprecations");
|
|
11
12
|
require("../util/register-ts-node");
|
|
12
13
|
let tmpConfig = (0, get_defaults_1.getDefaultAppConfig)();
|
|
@@ -20,4 +21,5 @@ tmpContext = (0, calculate_dependent_config_1.calculateDependentContext)(tmpConf
|
|
|
20
21
|
exports.appContext = tmpContext;
|
|
21
22
|
exports.appConfigs = tmpConfig;
|
|
22
23
|
exports.configs = Object.assign(Object.assign({}, exports.appConfigs), exports.appContext);
|
|
24
|
+
(0, validate_config_1.validateConfig)(exports.configs);
|
|
23
25
|
(0, warn_about_deprecations_1.warnAboutDeprecations)(exports.configs);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type DevTool, type Shared } from '@rspack/core';
|
|
2
2
|
import { type RspackDevServer } from '@rspack/dev-server';
|
|
3
|
+
import { type PluginOptions as ReactCompilerOptions } from 'babel-plugin-react-compiler';
|
|
3
4
|
/**
|
|
4
5
|
* Конфигурация arui-scripts, которая может быть переопределена приложением
|
|
5
6
|
*/
|
|
@@ -40,6 +41,7 @@ export type AppConfigs = {
|
|
|
40
41
|
};
|
|
41
42
|
keepPropTypes: boolean;
|
|
42
43
|
codeLoader: 'babel' | 'tsc' | 'swc';
|
|
44
|
+
experimentalReactCompiler: 'disabled' | ReactCompilerOptions;
|
|
43
45
|
installServerSourceMaps: boolean;
|
|
44
46
|
disableDevWebpackTypecheck: boolean;
|
|
45
47
|
jestCodeTransformer: 'babel' | 'tsc' | 'swc';
|
|
@@ -87,8 +89,10 @@ export type AppConfigs = {
|
|
|
87
89
|
};
|
|
88
90
|
export type ModuleConfigBase = {
|
|
89
91
|
cssPrefix?: false | string;
|
|
92
|
+
useSeparateBuild?: boolean;
|
|
90
93
|
};
|
|
91
|
-
type CompatModuleConfigBase =
|
|
94
|
+
type CompatModuleConfigBase = {
|
|
95
|
+
cssPrefix?: false | string;
|
|
92
96
|
entry: string;
|
|
93
97
|
externals?: Record<string, string>;
|
|
94
98
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateConfig = validateConfig;
|
|
4
|
+
function validateConfig(config) {
|
|
5
|
+
if (config.experimentalReactCompiler !== 'disabled' && config.codeLoader !== 'swc') {
|
|
6
|
+
throw new Error('Использование `experimentalReactCompiler` на данный момент поддерживается только с `codeLoader: "swc"`. \nЛибо выключите `experimentalReactCompiler`, либо измените настройку для `codeLoader`.');
|
|
7
|
+
}
|
|
8
|
+
}
|
|
@@ -2,7 +2,7 @@ import * as rspack from '@rspack/core';
|
|
|
2
2
|
import { type CompatModuleConfig } from './app-configs/types';
|
|
3
3
|
export declare function haveExposedDefaultModules(): Record<string, string> | undefined;
|
|
4
4
|
export declare const MODULES_ENTRY_NAME = "remoteEntry.js";
|
|
5
|
-
export declare function patchMainWebpackConfigForModules(webpackConf: rspack.Configuration): rspack.RspackOptions;
|
|
5
|
+
export declare function patchMainWebpackConfigForModules(webpackConf: rspack.Configuration, mode: 'consumer' | 'provider' | 'both'): rspack.RspackOptions;
|
|
6
6
|
export declare function getCssPrefixForModule(module: CompatModuleConfig): string | undefined;
|
|
7
7
|
export declare function getExposeLoadersFormCompatModules(): {
|
|
8
8
|
test: string;
|
package/build/configs/modules.js
CHANGED
|
@@ -39,9 +39,11 @@ function haveExposedDefaultModules() {
|
|
|
39
39
|
return (_a = app_configs_1.configs.modules) === null || _a === void 0 ? void 0 : _a.exposes;
|
|
40
40
|
}
|
|
41
41
|
exports.MODULES_ENTRY_NAME = 'remoteEntry.js';
|
|
42
|
-
function patchMainWebpackConfigForModules(webpackConf) {
|
|
42
|
+
function patchMainWebpackConfigForModules(webpackConf, mode) {
|
|
43
43
|
var _a;
|
|
44
44
|
/* eslint-disable no-param-reassign */
|
|
45
|
+
const isConsumer = mode === 'consumer' || mode === 'both';
|
|
46
|
+
const isProvider = mode === 'provider' || mode === 'both';
|
|
45
47
|
if (app_configs_1.configs.disableModulesSupport) {
|
|
46
48
|
// проект хочет сам разбираться с WMF и прочими вещами, полностью отключаем обработку модулей на своей стороне
|
|
47
49
|
return webpackConf;
|
|
@@ -50,16 +52,20 @@ function patchMainWebpackConfigForModules(webpackConf) {
|
|
|
50
52
|
// делаем TS счастливым, на самом деле module и plugins у нас будут всегда
|
|
51
53
|
return webpackConf;
|
|
52
54
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
+
if (isConsumer) {
|
|
56
|
+
// Добавляем expose loader для библиотек, которые мы хотим вынести в глобальную область видимости
|
|
57
|
+
webpackConf.module.rules.unshift(...getExposeLoadersFormCompatModules());
|
|
58
|
+
}
|
|
55
59
|
if (!app_configs_1.configs.modules || !webpackConf.output || !webpackConf.plugins) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
60
|
+
if (isConsumer) {
|
|
61
|
+
// webpack по умолчанию всегда добавлял runtime для шаринга, даже когда модули не включены.
|
|
62
|
+
// Rspack этого больше не делает, поэтому добавляем плагин для рантайма самостоятельно
|
|
63
|
+
webpackConf.plugins.push(new rspack.sharing.ProvideSharedPlugin({ provides: {} }));
|
|
64
|
+
}
|
|
59
65
|
return webpackConf;
|
|
60
66
|
}
|
|
61
67
|
const { cssPrefix } = app_configs_1.configs.modules.options || {};
|
|
62
|
-
if (cssPrefix) {
|
|
68
|
+
if (cssPrefix && isProvider) {
|
|
63
69
|
addCssPrefix(webpackConf, cssPrefix);
|
|
64
70
|
}
|
|
65
71
|
webpackConf.output.publicPath = haveExposedDefaultModules()
|
|
@@ -67,9 +73,9 @@ function patchMainWebpackConfigForModules(webpackConf) {
|
|
|
67
73
|
: app_configs_1.configs.publicPath;
|
|
68
74
|
webpackConf.plugins.push(new rspack.container.ModuleFederationPlugin({
|
|
69
75
|
name: app_configs_1.configs.modules.name || app_configs_1.configs.normalizedName,
|
|
70
|
-
filename: app_configs_1.configs.modules.exposes ? exports.MODULES_ENTRY_NAME : undefined,
|
|
76
|
+
filename: isProvider && app_configs_1.configs.modules.exposes ? exports.MODULES_ENTRY_NAME : undefined,
|
|
71
77
|
shared: app_configs_1.configs.modules.shared,
|
|
72
|
-
exposes: app_configs_1.configs.modules.exposes,
|
|
78
|
+
exposes: isProvider ? app_configs_1.configs.modules.exposes : {},
|
|
73
79
|
shareScope: app_configs_1.configs.modules.shareScope,
|
|
74
80
|
}), new turn_off_split_remote_entry_1.TurnOffSplitRemoteEntry(app_configs_1.configs.modules.name || app_configs_1.configs.normalizedName));
|
|
75
81
|
return webpackConf;
|
|
@@ -179,7 +179,7 @@ const createSingleClientWebpackConfig = (mode, entry, configName) => (Object.ass
|
|
|
179
179
|
// back to the "file" loader at the end of the loader list.
|
|
180
180
|
oneOf: [
|
|
181
181
|
// Обработка основного кода приложения
|
|
182
|
-
getCodeLoader(mode),
|
|
182
|
+
...getCodeLoader(mode),
|
|
183
183
|
// обработка ts кода если codeLoader = tsc
|
|
184
184
|
getTsLoaderIfEnabled(mode),
|
|
185
185
|
// Обработка внешнего для приложения кода (node_modules)
|
|
@@ -367,11 +367,18 @@ const createSingleClientWebpackConfig = (mode, entry, configName) => (Object.ass
|
|
|
367
367
|
} }));
|
|
368
368
|
exports.createSingleClientWebpackConfig = createSingleClientWebpackConfig;
|
|
369
369
|
const createClientWebpackConfig = (mode) => {
|
|
370
|
-
var _a;
|
|
371
|
-
const
|
|
372
|
-
|
|
370
|
+
var _a, _b, _c;
|
|
371
|
+
const baseWebpackConfig = [(0, exports.createSingleClientWebpackConfig)(mode, app_configs_1.configs.clientEntry)];
|
|
372
|
+
if ((_b = (_a = app_configs_1.configs.modules) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.useSeparateBuild) {
|
|
373
|
+
baseWebpackConfig[0] = (0, modules_1.patchMainWebpackConfigForModules)(baseWebpackConfig[0], 'consumer');
|
|
374
|
+
baseWebpackConfig.push((0, modules_1.patchMainWebpackConfigForModules)((0, exports.createSingleClientWebpackConfig)(mode, {}, 'wmf'), 'provider'));
|
|
375
|
+
}
|
|
376
|
+
else {
|
|
377
|
+
baseWebpackConfig[0] = (0, modules_1.patchMainWebpackConfigForModules)(baseWebpackConfig[0], 'both');
|
|
378
|
+
}
|
|
379
|
+
const exposedCompatModules = (_c = app_configs_1.configs.compatModules) === null || _c === void 0 ? void 0 : _c.exposes;
|
|
373
380
|
if (!exposedCompatModules || Object.keys(exposedCompatModules).length === 0) {
|
|
374
|
-
return
|
|
381
|
+
return baseWebpackConfig.length === 1 ? baseWebpackConfig[0] : baseWebpackConfig;
|
|
375
382
|
}
|
|
376
383
|
// Добавляем отдельные конфигурации для compat модулей
|
|
377
384
|
const modulesWebpackConfigs = Object.keys(exposedCompatModules).map((moduleName) => {
|
|
@@ -381,30 +388,68 @@ const createClientWebpackConfig = (mode) => {
|
|
|
381
388
|
}, module.name);
|
|
382
389
|
return (0, modules_1.patchWebpackConfigForCompat)(module, config);
|
|
383
390
|
});
|
|
384
|
-
return [
|
|
391
|
+
return [...baseWebpackConfig, ...modulesWebpackConfigs];
|
|
385
392
|
};
|
|
386
393
|
exports.createClientWebpackConfig = createClientWebpackConfig;
|
|
387
394
|
function getCodeLoader(mode) {
|
|
388
395
|
var _a, _b, _c;
|
|
389
396
|
if (app_configs_1.configs.codeLoader === 'swc') {
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
397
|
+
const swcOptions = Object.assign(Object.assign({}, swc_1.swcClientConfig), { jsc: Object.assign(Object.assign({}, swc_1.swcClientConfig.jsc), { transform: Object.assign(Object.assign({}, (_a = swc_1.swcClientConfig.jsc) === null || _a === void 0 ? void 0 : _a.transform), { react: Object.assign(Object.assign({}, (_c = (_b = swc_1.swcClientConfig.jsc) === null || _b === void 0 ? void 0 : _b.transform) === null || _c === void 0 ? void 0 : _c.react), { refresh: mode === 'dev' }) }) }) });
|
|
398
|
+
if (app_configs_1.configs.experimentalReactCompiler !== 'disabled') {
|
|
399
|
+
return [
|
|
400
|
+
{
|
|
401
|
+
test: /\.(js|mjs|ts|cjs)$/,
|
|
402
|
+
include: app_configs_1.configs.appSrc,
|
|
403
|
+
loader: 'builtin:swc-loader',
|
|
404
|
+
options: swcOptions,
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
test: /\.(jsx|tsx)$/,
|
|
408
|
+
include: app_configs_1.configs.appSrc,
|
|
409
|
+
use: [
|
|
410
|
+
{
|
|
411
|
+
loader: 'builtin:swc-loader',
|
|
412
|
+
options: swcOptions,
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
loader: 'babel-loader',
|
|
416
|
+
options: {
|
|
417
|
+
plugins: [
|
|
418
|
+
[
|
|
419
|
+
'babel-plugin-react-compiler',
|
|
420
|
+
{ target: app_configs_1.configs.experimentalReactCompiler.target },
|
|
421
|
+
],
|
|
422
|
+
'@babel/plugin-syntax-jsx',
|
|
423
|
+
['@babel/plugin-syntax-typescript', { isTSX: true }],
|
|
424
|
+
],
|
|
425
|
+
},
|
|
426
|
+
},
|
|
427
|
+
],
|
|
428
|
+
},
|
|
429
|
+
];
|
|
430
|
+
}
|
|
431
|
+
return [
|
|
432
|
+
{
|
|
433
|
+
test: /\.(js|jsx|mjs|ts|tsx|cjs)$/,
|
|
434
|
+
include: app_configs_1.configs.appSrc,
|
|
435
|
+
loader: 'builtin:swc-loader',
|
|
436
|
+
options: swcOptions,
|
|
437
|
+
},
|
|
438
|
+
];
|
|
396
439
|
}
|
|
397
|
-
return
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
440
|
+
return [
|
|
441
|
+
{
|
|
442
|
+
test: app_configs_1.configs.codeLoader === 'tsc' ? /\.(js|jsx|mjs|cjs)$/ : /\.(js|jsx|mjs|ts|tsx|cjs)$/,
|
|
443
|
+
include: app_configs_1.configs.appSrc,
|
|
444
|
+
loader: require.resolve('babel-loader'),
|
|
445
|
+
options: Object.assign(Object.assign({}, babel_client_1.babelClientConfig), { cacheDirectory: mode === 'dev', cacheCompression: false, plugins: [
|
|
446
|
+
...babel_client_1.babelClientConfig.plugins,
|
|
447
|
+
mode === 'dev'
|
|
448
|
+
? [require.resolve('react-refresh/babel'), { skipEnvCheck: true }]
|
|
449
|
+
: undefined,
|
|
450
|
+
].filter(Boolean) }),
|
|
451
|
+
},
|
|
452
|
+
];
|
|
408
453
|
}
|
|
409
454
|
function getTsLoaderIfEnabled(mode) {
|
|
410
455
|
if (app_configs_1.configs.codeLoader !== 'tsc' || !app_configs_1.configs.tsconfig) {
|
|
@@ -89,7 +89,7 @@ const createServerConfig = (mode) => ({
|
|
|
89
89
|
{
|
|
90
90
|
oneOf: [
|
|
91
91
|
// Обработка основного кода приложения
|
|
92
|
-
getCodeLoader(mode),
|
|
92
|
+
...getCodeLoader(mode),
|
|
93
93
|
// обработка ts кода если codeLoader = tsc
|
|
94
94
|
getTsLoaderIfEnabled(mode),
|
|
95
95
|
// Обработка внешнего для приложения кода (node_modules)
|
|
@@ -187,23 +187,60 @@ const createServerConfig = (mode) => ({
|
|
|
187
187
|
exports.createServerConfig = createServerConfig;
|
|
188
188
|
function getCodeLoader(mode) {
|
|
189
189
|
if (app_configs_1.configs.codeLoader === 'swc') {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
190
|
+
if (app_configs_1.configs.experimentalReactCompiler !== 'disabled') {
|
|
191
|
+
return [
|
|
192
|
+
{
|
|
193
|
+
test: /\.(js|mjs|ts|cjs)$/,
|
|
194
|
+
include: app_configs_1.configs.appSrc,
|
|
195
|
+
loader: 'builtin:swc-loader',
|
|
196
|
+
options: swc_1.swcServerConfig,
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
test: /\.(jsx|tsx)$/,
|
|
200
|
+
include: app_configs_1.configs.appSrc,
|
|
201
|
+
use: [
|
|
202
|
+
{
|
|
203
|
+
loader: 'builtin:swc-loader',
|
|
204
|
+
options: swc_1.swcServerConfig,
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
loader: 'babel-loader',
|
|
208
|
+
options: {
|
|
209
|
+
plugins: [
|
|
210
|
+
[
|
|
211
|
+
'babel-plugin-react-compiler',
|
|
212
|
+
{ target: app_configs_1.configs.experimentalReactCompiler.target },
|
|
213
|
+
],
|
|
214
|
+
'@babel/plugin-syntax-jsx',
|
|
215
|
+
['@babel/plugin-syntax-typescript', { isTSX: true }],
|
|
216
|
+
],
|
|
217
|
+
},
|
|
218
|
+
},
|
|
219
|
+
],
|
|
220
|
+
},
|
|
221
|
+
];
|
|
222
|
+
}
|
|
223
|
+
return [
|
|
224
|
+
{
|
|
225
|
+
test: /\.(js|jsx|mjs|ts|tsx|cjs)$/,
|
|
226
|
+
include: app_configs_1.configs.appSrc,
|
|
227
|
+
loader: 'builtin:swc-loader',
|
|
228
|
+
options: swc_1.swcServerConfig,
|
|
229
|
+
},
|
|
230
|
+
];
|
|
196
231
|
}
|
|
197
|
-
return
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
232
|
+
return [
|
|
233
|
+
{
|
|
234
|
+
test: app_configs_1.configs.codeLoader === 'tsc' ? /\.(js|jsx|mjs|cjs)$/ : /\.(js|jsx|mjs|ts|tsx|cjs)$/,
|
|
235
|
+
include: app_configs_1.configs.appSrc,
|
|
236
|
+
loader: require.resolve('babel-loader'),
|
|
237
|
+
options: Object.assign(Object.assign({}, babel_server_1.config), {
|
|
238
|
+
// This is a feature of `babel-loader` for webpack (not Babel itself).
|
|
239
|
+
// It enables caching results in ./node_modules/.cache/babel-loader/
|
|
240
|
+
// directory for faster rebuilds.
|
|
241
|
+
cacheDirectory: mode === 'dev' }),
|
|
242
|
+
},
|
|
243
|
+
];
|
|
207
244
|
}
|
|
208
245
|
function getTsLoaderIfEnabled(mode) {
|
|
209
246
|
if (app_configs_1.configs.codeLoader !== 'tsc' || !app_configs_1.configs.tsconfig) {
|
|
@@ -31,7 +31,7 @@ node_memory_limit="$(($max_total_memory / 1024 / 1024 - 100))"
|
|
|
31
31
|
nginx &
|
|
32
32
|
|
|
33
33
|
# Start nodejs process
|
|
34
|
-
node --max-old-space-size="$node_memory_limit" ./${app_configs_1.configs.buildPath}/${app_configs_1.configs.serverOutput}
|
|
34
|
+
exec node --max-old-space-size="$node_memory_limit" ./${app_configs_1.configs.buildPath}/${app_configs_1.configs.serverOutput}
|
|
35
35
|
`;
|
|
36
36
|
const envConfigTargetPath = `/src/${app_configs_1.configs.buildPath}/${client_env_config_1.ENV_CONFIG_FILENAME}`;
|
|
37
37
|
const envConfigPath = `/src/${client_env_config_1.ENV_CONFIG_FILENAME}`;
|