arui-scripts 17.0.2 → 17.1.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/.turbo/turbo-lint.log +16 -27
- package/.turbo/turbo-test.log +4 -4
- package/CHANGELOG.md +12 -0
- package/README.md +1 -0
- package/build/commands/build/index.js +8 -1
- package/build/commands/bundle-analyze/index.js +2 -2
- package/build/commands/start/index.js +10 -16
- package/build/commands/start-prod/index.js +12 -1
- package/build/commands/util/tsc.d.ts +1 -0
- package/build/commands/util/tsc.js +14 -0
- package/build/commands/util/yarn.js +5 -2
- package/build/configs/app-configs/calculate-dependent-config.d.ts +1 -0
- package/build/configs/app-configs/get-defaults.js +1 -0
- package/build/configs/app-configs/types.d.ts +1 -0
- package/build/configs/dev-server.js +37 -34
- package/build/configs/util/apply-overrides.d.ts +1 -0
- package/build/configs/webpack.client.js +58 -44
- package/build/templates/dockerfile.template.js +11 -6
- package/build/templates/html.template.d.ts +1 -0
- package/build/templates/html.template.js +22 -0
- package/build/templates/nginx.conf.template.js +14 -9
- package/build/tsconfig-local.tsbuildinfo +1 -1
- package/docs/client-only.md +11 -0
- package/docs/commands.md +2 -0
- package/docs/overrides.md +2 -1
- package/docs/settings.md +4 -0
- package/package.json +2 -1
package/.turbo/turbo-lint.log
CHANGED
|
@@ -23,9 +23,6 @@
|
|
|
23
23
|
81:9 warning Unexpected console statement no-console
|
|
24
24
|
83:13 warning Unexpected console statement no-console
|
|
25
25
|
|
|
26
|
-
/home/runner/work/arui-scripts/arui-scripts/packages/arui-scripts/src/commands/bundle-analyze/index.ts
|
|
27
|
-
6:8 warning Using exported name 'configs' as identifier for default export import/no-named-as-default
|
|
28
|
-
|
|
29
26
|
/home/runner/work/arui-scripts/arui-scripts/packages/arui-scripts/src/commands/changelog/index.ts
|
|
30
27
|
11:8 warning Using exported name 'configs' as identifier for default export import/no-named-as-default
|
|
31
28
|
|
|
@@ -55,8 +52,8 @@
|
|
|
55
52
|
71:9 warning Unexpected console statement no-console
|
|
56
53
|
73:13 warning Unexpected console statement no-console
|
|
57
54
|
|
|
58
|
-
/home/runner/work/arui-scripts/arui-scripts/packages/arui-scripts/src/commands/start/index.ts
|
|
59
|
-
1:
|
|
55
|
+
/home/runner/work/arui-scripts/arui-scripts/packages/arui-scripts/src/commands/start-prod/index.ts
|
|
56
|
+
1:1 warning Run autofix to sort these imports! simple-import-sort/imports
|
|
60
57
|
|
|
61
58
|
/home/runner/work/arui-scripts/arui-scripts/packages/arui-scripts/src/commands/start/print-compiler-output.ts
|
|
62
59
|
5:8 warning Prefer named exports import/no-default-export
|
|
@@ -108,9 +105,6 @@
|
|
|
108
105
|
10:54 warning Unexpected console statement no-console
|
|
109
106
|
11:53 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
|
110
107
|
|
|
111
|
-
/home/runner/work/arui-scripts/arui-scripts/packages/arui-scripts/src/commands/util/yarn.ts
|
|
112
|
-
3:8 warning Using exported name 'configs' as identifier for default export import/no-named-as-default
|
|
113
|
-
|
|
114
108
|
/home/runner/work/arui-scripts/arui-scripts/packages/arui-scripts/src/configs/app-configs/__tests__/update-with-presets.tests.ts
|
|
115
109
|
26:28 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
|
116
110
|
56:45 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
|
@@ -122,8 +116,8 @@
|
|
|
122
116
|
32:8 warning Prefer named exports import/no-default-export
|
|
123
117
|
|
|
124
118
|
/home/runner/work/arui-scripts/arui-scripts/packages/arui-scripts/src/configs/app-configs/types.ts
|
|
125
|
-
|
|
126
|
-
|
|
119
|
+
89:17 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
|
120
|
+
108:17 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
|
127
121
|
|
|
128
122
|
/home/runner/work/arui-scripts/arui-scripts/packages/arui-scripts/src/configs/app-configs/update-with-env.ts
|
|
129
123
|
12:9 warning Unexpected console statement no-console
|
|
@@ -147,8 +141,7 @@
|
|
|
147
141
|
3:8 warning Using exported name 'configs' as identifier for default export import/no-named-as-default
|
|
148
142
|
|
|
149
143
|
/home/runner/work/arui-scripts/arui-scripts/packages/arui-scripts/src/configs/dev-server.ts
|
|
150
|
-
|
|
151
|
-
71:8 warning Prefer named exports import/no-default-export
|
|
144
|
+
75:8 warning Prefer named exports import/no-default-export
|
|
152
145
|
|
|
153
146
|
/home/runner/work/arui-scripts/arui-scripts/packages/arui-scripts/src/configs/jest/index.js
|
|
154
147
|
16:13 warning Unexpected console statement no-console
|
|
@@ -191,11 +184,11 @@
|
|
|
191
184
|
27:18 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
|
192
185
|
28:24 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
|
193
186
|
30:14 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
187
|
+
43:38 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
|
188
|
+
102:9 warning Unexpected console statement no-console
|
|
189
|
+
103:9 warning Unexpected console statement no-console
|
|
190
|
+
121:48 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
|
191
|
+
144:8 warning Prefer named exports import/no-default-export
|
|
199
192
|
|
|
200
193
|
/home/runner/work/arui-scripts/arui-scripts/packages/arui-scripts/src/configs/util/check-node-version.ts
|
|
201
194
|
7:8 warning Prefer named exports import/no-default-export
|
|
@@ -226,11 +219,9 @@
|
|
|
226
219
|
16:8 warning Prefer named exports import/no-default-export
|
|
227
220
|
|
|
228
221
|
/home/runner/work/arui-scripts/arui-scripts/packages/arui-scripts/src/configs/webpack.client.ts
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
183:58 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
|
233
|
-
427:52 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
|
222
|
+
167:47 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
|
223
|
+
186:58 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
|
224
|
+
440:60 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
|
234
225
|
|
|
235
226
|
/home/runner/work/arui-scripts/arui-scripts/packages/arui-scripts/src/configs/webpack.server.dev.ts
|
|
236
227
|
12:8 warning Prefer named exports import/no-default-export
|
|
@@ -254,12 +245,10 @@
|
|
|
254
245
|
48:8 warning Prefer named exports import/no-default-export
|
|
255
246
|
|
|
256
247
|
/home/runner/work/arui-scripts/arui-scripts/packages/arui-scripts/src/templates/dockerfile.template.ts
|
|
257
|
-
|
|
258
|
-
30:8 warning Prefer named exports import/no-default-export
|
|
248
|
+
36:8 warning Prefer named exports import/no-default-export
|
|
259
249
|
|
|
260
250
|
/home/runner/work/arui-scripts/arui-scripts/packages/arui-scripts/src/templates/nginx.conf.template.ts
|
|
261
|
-
|
|
262
|
-
31:8 warning Prefer named exports import/no-default-export
|
|
251
|
+
36:8 warning Prefer named exports import/no-default-export
|
|
263
252
|
|
|
264
253
|
/home/runner/work/arui-scripts/arui-scripts/packages/arui-scripts/src/templates/start.template.ts
|
|
265
254
|
1:8 warning Using exported name 'configs' as identifier for default export import/no-named-as-default
|
|
@@ -268,6 +257,6 @@
|
|
|
268
257
|
/home/runner/work/arui-scripts/arui-scripts/packages/arui-scripts/src/types.d.ts
|
|
269
258
|
4:12 warning Prefer named exports import/no-default-export
|
|
270
259
|
|
|
271
|
-
✖
|
|
260
|
+
✖ 142 problems (0 errors, 142 warnings)
|
|
272
261
|
0 errors and 2 warnings potentially fixable with the `--fix` option.
|
|
273
262
|
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
PASS src/configs/
|
|
2
|
-
PASS src/configs/
|
|
1
|
+
PASS src/configs/app-configs/__tests__/update-with-presets.tests.ts (33.866 s)
|
|
2
|
+
PASS src/configs/util/__tests__/get-polyfills.tests.ts (34.399 s)
|
|
3
3
|
PASS src/configs/util/__tests__/apply-overrides.tests.ts
|
|
4
4
|
PASS src/configs/app-configs/__tests__/update-with-env.tests.ts
|
|
5
5
|
PASS src/configs/app-configs/__tests__/update-with-package.tests.ts
|
|
@@ -8,10 +8,10 @@ Failed to load /home/runner/work/arui-scripts/arui-scripts/packages/arui-scripts
|
|
|
8
8
|
Failed to load /home/runner/work/arui-scripts/arui-scripts/packages/arui-scripts/tsconfig.json: Missing baseUrl in compilerOptions
|
|
9
9
|
Failed to load /home/runner/work/arui-scripts/arui-scripts/packages/arui-scripts/tsconfig.json: Missing baseUrl in compilerOptions
|
|
10
10
|
Failed to load /home/runner/work/arui-scripts/arui-scripts/packages/arui-scripts/tsconfig.json: Missing baseUrl in compilerOptions
|
|
11
|
-
PASS src/configs/util/__tests__/find-plugin.tests.ts (
|
|
11
|
+
PASS src/configs/util/__tests__/find-plugin.tests.ts (38.213 s)
|
|
12
12
|
|
|
13
13
|
Test Suites: 7 passed, 7 total
|
|
14
14
|
Tests: 21 passed, 21 total
|
|
15
15
|
Snapshots: 0 total
|
|
16
|
-
Time:
|
|
16
|
+
Time: 39.964 s
|
|
17
17
|
Ran all test suites.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
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
|
+
## 17.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#223](https://github.com/core-ds/arui-scripts/pull/223) [`028c5d3`](https://github.com/core-ds/arui-scripts/commit/028c5d34f99353e5123b64b6a319428d42aa56bb) Thanks [@qrik116](https://github.com/qrik116)! - Исправлено формирование имени css файлов, с учётом configName
|
|
8
|
+
|
|
9
|
+
## 17.1.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#221](https://github.com/core-ds/arui-scripts/pull/221) [`4e7843f`](https://github.com/core-ds/arui-scripts/commit/4e7843f4e2ca53e62e9c15c782ab3ec05e9c0d1e) Thanks [@heymdall-legal](https://github.com/heymdall-legal)! - Добавлен режим clientOnly, позволяющий использовать arui-scripts для сборки проектов, не требующих серверной части
|
|
14
|
+
|
|
3
15
|
## 17.0.2
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const run_compilers_1 = require("../util/run-compilers");
|
|
4
|
+
const app_configs_1 = require("../../configs/app-configs");
|
|
4
5
|
process.env.BABEL_ENV = 'production';
|
|
5
6
|
process.env.NODE_ENV = 'production';
|
|
6
7
|
process.env.BROWSERSLIST_CONFIG =
|
|
7
8
|
process.env.BROWSERSLIST_CONFIG || require.resolve('../../../.browserslistrc');
|
|
8
|
-
|
|
9
|
+
const compilersCommands = [
|
|
10
|
+
require.resolve('./client'),
|
|
11
|
+
];
|
|
12
|
+
if (!app_configs_1.configs.clientOnly) {
|
|
13
|
+
compilersCommands.push(require.resolve('./server'));
|
|
14
|
+
}
|
|
15
|
+
(0, run_compilers_1.runCompilers)(compilersCommands);
|
|
@@ -16,7 +16,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
16
16
|
/* eslint-disable no-param-reassign */
|
|
17
17
|
const webpack_1 = __importDefault(require("webpack"));
|
|
18
18
|
const webpack_bundle_analyzer_1 = require("webpack-bundle-analyzer");
|
|
19
|
-
const app_configs_1 =
|
|
19
|
+
const app_configs_1 = require("../../configs/app-configs");
|
|
20
20
|
const webpack_client_prod_1 = __importDefault(require("../../configs/webpack.client.prod"));
|
|
21
21
|
const make_tmp_dir_1 = __importDefault(require("../util/make-tmp-dir"));
|
|
22
22
|
(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -27,7 +27,7 @@ const make_tmp_dir_1 = __importDefault(require("../util/make-tmp-dir"));
|
|
|
27
27
|
...(webpackConfig.plugins || []),
|
|
28
28
|
new webpack_bundle_analyzer_1.BundleAnalyzerPlugin({
|
|
29
29
|
generateStatsFile: true,
|
|
30
|
-
statsFilename: app_configs_1.
|
|
30
|
+
statsFilename: app_configs_1.configs.statsOutputPath,
|
|
31
31
|
analyzerPort: 'auto',
|
|
32
32
|
}),
|
|
33
33
|
];
|
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const app_configs_1 =
|
|
3
|
+
const app_configs_1 = require("../../configs/app-configs");
|
|
7
4
|
const run_compilers_1 = require("../util/run-compilers");
|
|
5
|
+
const tsc_1 = require("../util/tsc");
|
|
8
6
|
process.env.BROWSERSLIST_CONFIG =
|
|
9
7
|
process.env.BROWSERSLIST_CONFIG || require.resolve('../../../.browserslistrc');
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
'--project',
|
|
16
|
-
app_configs_1.default.tsconfig,
|
|
17
|
-
'--skipLibCheck',
|
|
18
|
-
];
|
|
19
|
-
(0, run_compilers_1.runCompilers)([require.resolve('./client'), require.resolve('./server'), TSC_WATCH_COMMAND]);
|
|
8
|
+
const compilersCommands = [
|
|
9
|
+
require.resolve('./client'),
|
|
10
|
+
];
|
|
11
|
+
if (!app_configs_1.configs.clientOnly) {
|
|
12
|
+
compilersCommands.push(require.resolve('./server'));
|
|
20
13
|
}
|
|
21
|
-
|
|
22
|
-
(0,
|
|
14
|
+
if (app_configs_1.configs.tsconfig && app_configs_1.configs.disableDevWebpackTypecheck) {
|
|
15
|
+
compilersCommands.push((0, tsc_1.getTscWatchCommand)(app_configs_1.configs.tsconfig));
|
|
23
16
|
}
|
|
17
|
+
(0, run_compilers_1.runCompilers)(compilersCommands);
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const app_configs_1 = require("../../configs/app-configs");
|
|
4
|
+
const tsc_1 = require("../util/tsc");
|
|
3
5
|
const run_compilers_1 = require("../util/run-compilers");
|
|
4
6
|
process.env.BROWSERSLIST_CONFIG =
|
|
5
7
|
process.env.BROWSERSLIST_CONFIG || require.resolve('../../../.browserslistrc');
|
|
6
|
-
|
|
8
|
+
const compilersCommands = [
|
|
9
|
+
require.resolve('./client'),
|
|
10
|
+
];
|
|
11
|
+
if (!app_configs_1.configs.clientOnly) {
|
|
12
|
+
compilersCommands.push(require.resolve('./server'));
|
|
13
|
+
}
|
|
14
|
+
if (app_configs_1.configs.tsconfig && app_configs_1.configs.disableDevWebpackTypecheck) {
|
|
15
|
+
compilersCommands.push((0, tsc_1.getTscWatchCommand)(app_configs_1.configs.tsconfig));
|
|
16
|
+
}
|
|
17
|
+
(0, run_compilers_1.runCompilers)(compilersCommands);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getTscWatchCommand(tsconfig: string): string[];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTscWatchCommand = void 0;
|
|
4
|
+
function getTscWatchCommand(tsconfig) {
|
|
5
|
+
return [
|
|
6
|
+
require.resolve('typescript/lib/tsc.js'),
|
|
7
|
+
'--watch',
|
|
8
|
+
'--noEmit',
|
|
9
|
+
'--project',
|
|
10
|
+
tsconfig,
|
|
11
|
+
'--skipLibCheck',
|
|
12
|
+
];
|
|
13
|
+
}
|
|
14
|
+
exports.getTscWatchCommand = getTscWatchCommand;
|
|
@@ -5,9 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getInstallProductionCommand = exports.getPruningCommand = exports.getYarnVersion = void 0;
|
|
7
7
|
const shelljs_1 = __importDefault(require("shelljs"));
|
|
8
|
-
const app_configs_1 =
|
|
8
|
+
const app_configs_1 = require("../../configs/app-configs");
|
|
9
9
|
function getYarnVersion() {
|
|
10
|
-
if (app_configs_1.
|
|
10
|
+
if (app_configs_1.configs.useYarn && shelljs_1.default.which('yarn')) {
|
|
11
11
|
const yarnVersion = shelljs_1.default.exec('yarn -v', { silent: true });
|
|
12
12
|
const yarnMajorVersion = Number(yarnVersion.split('.')[0]);
|
|
13
13
|
return yarnMajorVersion > 1 ? '2+' : '1';
|
|
@@ -16,6 +16,9 @@ function getYarnVersion() {
|
|
|
16
16
|
}
|
|
17
17
|
exports.getYarnVersion = getYarnVersion;
|
|
18
18
|
function getPruningCommand() {
|
|
19
|
+
if (app_configs_1.configs.clientOnly) {
|
|
20
|
+
return 'echo "Skipping pruning in client only mode"';
|
|
21
|
+
}
|
|
19
22
|
const yarnVersion = getYarnVersion();
|
|
20
23
|
switch (yarnVersion) {
|
|
21
24
|
case '1': {
|
|
@@ -14,6 +14,7 @@ export declare function calculateDependentConfig(config: AppConfigs): {
|
|
|
14
14
|
proxy: {
|
|
15
15
|
[url: string]: import("webpack-dev-server").ProxyConfigArrayItem;
|
|
16
16
|
} | null;
|
|
17
|
+
clientOnly: boolean;
|
|
17
18
|
buildPath: string;
|
|
18
19
|
assetsPath: string;
|
|
19
20
|
additionalBuildPath: string[];
|
|
@@ -24,6 +24,7 @@ function getDefaultAppConfig() {
|
|
|
24
24
|
useServerHMR: false,
|
|
25
25
|
presets: (configFile === null || configFile === void 0 ? void 0 : configFile.presets) || ((_a = appPackage === null || appPackage === void 0 ? void 0 : appPackage.aruiScripts) === null || _a === void 0 ? void 0 : _a.presets) || null,
|
|
26
26
|
proxy: appPackage.proxy || null,
|
|
27
|
+
clientOnly: false,
|
|
27
28
|
// paths
|
|
28
29
|
buildPath: '.build',
|
|
29
30
|
assetsPath: 'assets',
|
|
@@ -5,9 +5,38 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const path_1 = __importDefault(require("path"));
|
|
7
7
|
const apply_overrides_1 = __importDefault(require("./util/apply-overrides"));
|
|
8
|
-
const app_configs_1 =
|
|
8
|
+
const app_configs_1 = require("./app-configs");
|
|
9
|
+
const serverProxyConfig = {
|
|
10
|
+
'/**': Object.assign({ target: `http://127.0.0.1:${app_configs_1.configs.serverPort}`, bypass: (req) => {
|
|
11
|
+
var _a;
|
|
12
|
+
const assetsRoot = path_1.default.normalize(`/${app_configs_1.configs.publicPath}`).replace(/\\/g, '/');
|
|
13
|
+
if ((_a = req === null || req === void 0 ? void 0 : req.url) === null || _a === void 0 ? void 0 : _a.startsWith(assetsRoot)) {
|
|
14
|
+
return req.url;
|
|
15
|
+
}
|
|
16
|
+
return null;
|
|
17
|
+
} }, (app_configs_1.configs.devSourceMaps.includes('eval') || app_configs_1.configs.devServerCors
|
|
18
|
+
? {
|
|
19
|
+
onProxyRes: (proxyRes) => {
|
|
20
|
+
// Для дев режима, когда мы используем в качестве соурсмапов что-то, основанное на eval - нужно
|
|
21
|
+
// разрешить браузеру исполнять наш код, даже когда content-security-policy приложения не позволяет этого делать.
|
|
22
|
+
if (app_configs_1.configs.devSourceMaps.includes('eval')) {
|
|
23
|
+
const cspHeader = proxyRes.headers['content-security-policy'];
|
|
24
|
+
if (typeof cspHeader === 'string' &&
|
|
25
|
+
!cspHeader.includes('unsafe-eval')) {
|
|
26
|
+
proxyRes.headers['content-security-policy'] = cspHeader.replace(/script-src/, "script-src 'unsafe-eval'");
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
// если включен devServerCors, то нужно принудительно менять статус ответа на 200, чтобы
|
|
30
|
+
// браузер не отклонял ответы с CORS
|
|
31
|
+
if (app_configs_1.configs.devServerCors && proxyRes.method === 'OPTIONS') {
|
|
32
|
+
proxyRes.statusCode = 200;
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
}
|
|
36
|
+
: {})),
|
|
37
|
+
};
|
|
9
38
|
const devServerConfig = (0, apply_overrides_1.default)('devServer', {
|
|
10
|
-
port: app_configs_1.
|
|
39
|
+
port: app_configs_1.configs.clientServerPort,
|
|
11
40
|
liveReload: false,
|
|
12
41
|
client: {
|
|
13
42
|
overlay: {
|
|
@@ -16,39 +45,13 @@ const devServerConfig = (0, apply_overrides_1.default)('devServer', {
|
|
|
16
45
|
},
|
|
17
46
|
},
|
|
18
47
|
devMiddleware: {
|
|
19
|
-
publicPath: `/${app_configs_1.
|
|
48
|
+
publicPath: `/${app_configs_1.configs.publicPath}`,
|
|
49
|
+
// dev-сервер не может корректно обработать файлы, которые лежат на уровень выше чем publicPath, а html, создаваемый для client-only режима как раз такой
|
|
50
|
+
writeToDisk: (filename) => filename.endsWith('.html'),
|
|
20
51
|
},
|
|
21
|
-
static: [app_configs_1.
|
|
22
|
-
proxy: Object.assign(app_configs_1.
|
|
23
|
-
|
|
24
|
-
var _a;
|
|
25
|
-
const assetsRoot = path_1.default.normalize(`/${app_configs_1.default.publicPath}`).replace(/\\/g, '/');
|
|
26
|
-
if ((_a = req === null || req === void 0 ? void 0 : req.url) === null || _a === void 0 ? void 0 : _a.startsWith(assetsRoot)) {
|
|
27
|
-
return req.url;
|
|
28
|
-
}
|
|
29
|
-
return null;
|
|
30
|
-
} }, (app_configs_1.default.devSourceMaps.includes('eval') || app_configs_1.default.devServerCors
|
|
31
|
-
? {
|
|
32
|
-
onProxyRes: (proxyRes) => {
|
|
33
|
-
// Для дев режима, когда мы используем в качестве соурсмапов что-то, основанное на eval - нужно
|
|
34
|
-
// разрешить браузеру исполнять наш код, даже когда content-security-policy приложения не позволяет этого делать.
|
|
35
|
-
if (app_configs_1.default.devSourceMaps.includes('eval')) {
|
|
36
|
-
const cspHeader = proxyRes.headers['content-security-policy'];
|
|
37
|
-
if (typeof cspHeader === 'string' &&
|
|
38
|
-
!cspHeader.includes('unsafe-eval')) {
|
|
39
|
-
proxyRes.headers['content-security-policy'] = cspHeader.replace(/script-src/, "script-src 'unsafe-eval'");
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
// если включен devServerCors, то нужно принудительно менять статус ответа на 200, чтобы
|
|
43
|
-
// браузер не отклонял ответы с CORS
|
|
44
|
-
if (app_configs_1.default.devServerCors && proxyRes.method === 'OPTIONS') {
|
|
45
|
-
proxyRes.statusCode = 200;
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
}
|
|
49
|
-
: {})),
|
|
50
|
-
}),
|
|
51
|
-
headers: app_configs_1.default.devServerCors
|
|
52
|
+
static: [app_configs_1.configs.serverOutputPath],
|
|
53
|
+
proxy: Object.assign(app_configs_1.configs.proxy || {}, app_configs_1.configs.clientOnly ? {} : serverProxyConfig),
|
|
54
|
+
headers: app_configs_1.configs.devServerCors
|
|
52
55
|
? {
|
|
53
56
|
'Access-Control-Allow-Origin': '*',
|
|
54
57
|
'Access-Control-Allow-Headers': '*',
|
|
@@ -28,6 +28,7 @@ type Overrides = {
|
|
|
28
28
|
nginx: string;
|
|
29
29
|
'start.sh': string;
|
|
30
30
|
serverExternalsExemptions: Array<string | RegExp>;
|
|
31
|
+
html: string;
|
|
31
32
|
};
|
|
32
33
|
type OmitFirstArg<F> = F extends (x: any, ...args: infer P) => infer R ? (...args: P) => R : never;
|
|
33
34
|
type BoundCreateSingleClientWebpackConfig = OmitFirstArg<typeof createSingleClientWebpackConfig>;
|