arui-scripts 19.0.8 → 19.1.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.
Files changed (94) hide show
  1. package/.turbo/turbo-test.log +5 -5
  2. package/CHANGELOG.md +6 -0
  3. package/build/bin/index.js +0 -5
  4. package/build/commands/archive-build/index.js +18 -18
  5. package/build/commands/build/build-wrapper.js +3 -5
  6. package/build/commands/build/client.js +5 -7
  7. package/build/commands/build/index.js +1 -3
  8. package/build/commands/build/server.js +2 -4
  9. package/build/commands/bundle-analyze/index.js +7 -9
  10. package/build/commands/changelog/index.js +27 -9
  11. package/build/commands/docker-build/index.js +18 -18
  12. package/build/commands/docker-build-compiled/index.js +14 -14
  13. package/build/commands/ensure-yarn/index.js +0 -1
  14. package/build/commands/start/client.js +2 -5
  15. package/build/commands/start/index.js +1 -3
  16. package/build/commands/start/print-compiler-output.d.ts +2 -1
  17. package/build/commands/start/print-compiler-output.js +3 -3
  18. package/build/commands/start/server.js +2 -5
  19. package/build/commands/start-prod/client.js +2 -5
  20. package/build/commands/start-prod/index.js +1 -3
  21. package/build/commands/start-prod/server.js +2 -5
  22. package/build/commands/test/index.js +0 -2
  23. package/build/commands/util/client-assets-sizes.js +0 -1
  24. package/build/commands/util/docker-build.js +14 -14
  25. package/build/commands/util/exec.d.ts +1 -2
  26. package/build/commands/util/exec.js +2 -4
  27. package/build/commands/util/format-webpack-messages.d.ts +4 -10
  28. package/build/commands/util/format-webpack-messages.js +21 -22
  29. package/build/commands/util/make-tmp-dir.d.ts +1 -2
  30. package/build/commands/util/make-tmp-dir.js +1 -1
  31. package/build/commands/util/run-client-dev-server.js +7 -9
  32. package/build/commands/util/run-server-watch-compiler.js +4 -7
  33. package/build/configs/app-configs/index.d.ts +0 -1
  34. package/build/configs/app-configs/index.js +0 -1
  35. package/build/configs/app-configs/types.d.ts +2 -2
  36. package/build/configs/app-configs/warn-about-deprecations.js +5 -3
  37. package/build/configs/babel-client.d.ts +1 -2
  38. package/build/configs/babel-client.js +5 -8
  39. package/build/configs/babel-dependencies.js +4 -7
  40. package/build/configs/babel-server.d.ts +1 -2
  41. package/build/configs/babel-server.js +7 -10
  42. package/build/configs/dev-server.d.ts +1 -2
  43. package/build/configs/dev-server.js +7 -6
  44. package/build/configs/jest/babel-transform.js +1 -1
  45. package/build/configs/jest/settings.js +1 -1
  46. package/build/configs/modules.js +5 -3
  47. package/build/configs/postcss.config.d.ts +2 -2
  48. package/build/configs/postcss.config.js +9 -11
  49. package/build/configs/postcss.d.ts +1 -2
  50. package/build/configs/postcss.js +3 -8
  51. package/build/configs/process-assets-plugin-output.js +8 -8
  52. package/build/configs/server-externals-exemptions.js +2 -5
  53. package/build/configs/stats-options.d.ts +1 -2
  54. package/build/configs/stats-options.js +3 -6
  55. package/build/configs/supporting-browsers.d.ts +1 -2
  56. package/build/configs/supporting-browsers.js +3 -6
  57. package/build/configs/swc.js +5 -10
  58. package/build/configs/util/apply-overrides.d.ts +2 -2
  59. package/build/configs/util/apply-overrides.js +5 -9
  60. package/build/configs/util/check-node-version.d.ts +1 -2
  61. package/build/configs/util/check-node-version.js +1 -1
  62. package/build/configs/util/find-loader.js +3 -3
  63. package/build/configs/util/get-entry.d.ts +1 -2
  64. package/build/configs/util/get-entry.js +1 -1
  65. package/build/configs/util/get-webpack-cache-dependencies.js +4 -7
  66. package/build/configs/util/install-sourcemap-support.js +0 -1
  67. package/build/configs/util/register-ts-node.js +0 -1
  68. package/build/configs/webpack.client.dev.d.ts +1 -2
  69. package/build/configs/webpack.client.dev.js +3 -6
  70. package/build/configs/webpack.client.js +22 -33
  71. package/build/configs/webpack.client.prod.d.ts +1 -2
  72. package/build/configs/webpack.client.prod.js +3 -6
  73. package/build/configs/webpack.server.dev.d.ts +1 -2
  74. package/build/configs/webpack.server.dev.js +3 -6
  75. package/build/configs/webpack.server.js +35 -39
  76. package/build/configs/webpack.server.prod.d.ts +1 -2
  77. package/build/configs/webpack.server.prod.js +3 -6
  78. package/build/plugins/arui-runtime/index.js +2 -2
  79. package/build/plugins/postcss-global-variables/utils/utils.js +4 -4
  80. package/build/plugins/postcss-prefix-selector.js +5 -2
  81. package/build/templates/base-nginx.conf.template.d.ts +1 -2
  82. package/build/templates/base-nginx.conf.template.js +3 -5
  83. package/build/templates/dockerfile-compiled.template.d.ts +1 -2
  84. package/build/templates/dockerfile-compiled.template.js +7 -9
  85. package/build/templates/dockerfile.template.d.ts +1 -2
  86. package/build/templates/dockerfile.template.js +10 -8
  87. package/build/templates/html.template.js +2 -5
  88. package/build/templates/nginx.conf.template.d.ts +1 -2
  89. package/build/templates/nginx.conf.template.js +3 -5
  90. package/build/templates/start.template.d.ts +1 -2
  91. package/build/templates/start.template.js +3 -5
  92. package/build/tsconfig-local.tsbuildinfo +1 -1
  93. package/package.json +1 -1
  94. package/tsconfig.json +2 -1
@@ -1,11 +1,6 @@
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 apply_overrides_1 = __importDefault(require("./util/apply-overrides"));
3
+ exports.postcssConfig = void 0;
4
+ const apply_overrides_1 = require("./util/apply-overrides");
7
5
  const postcss_config_1 = require("./postcss.config");
8
- const postcssConfig = (0, apply_overrides_1.default)('postcss', (0, postcss_config_1.createPostcssConfig)(postcss_config_1.postcssPlugins, postcss_config_1.postcssPluginsOptions)).map((plugin) => typeof plugin === 'string' || Array.isArray(plugin)
9
- ? plugin
10
- : plugin.plugin(plugin.options));
11
- exports.default = postcssConfig;
6
+ exports.postcssConfig = (0, apply_overrides_1.applyOverrides)('postcss', (0, postcss_config_1.createPostcssConfig)(postcss_config_1.postcssPlugins, postcss_config_1.postcssPluginsOptions)).map((plugin) => typeof plugin === 'string' || Array.isArray(plugin) ? plugin : plugin.plugin(plugin.options));
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.processAssetsPluginOutput = processAssetsPluginOutput;
7
7
  const path_1 = __importDefault(require("path"));
8
- const app_configs_1 = __importDefault(require("./app-configs"));
8
+ const app_configs_1 = require("./app-configs");
9
9
  const modules_1 = require("./modules");
10
10
  function processAssetsPluginOutput(assets) {
11
11
  var _a;
@@ -18,19 +18,19 @@ function processAssetsPluginOutput(assets) {
18
18
  };
19
19
  });
20
20
  // добавляем в манифест js-файлы для модулей
21
- Object.keys(((_a = app_configs_1.default.modules) === null || _a === void 0 ? void 0 : _a.exposes) || {}).forEach((moduleName) => {
21
+ Object.keys(((_a = app_configs_1.configs.modules) === null || _a === void 0 ? void 0 : _a.exposes) || {}).forEach((moduleName) => {
22
22
  var _a, _b;
23
- if ((_b = (_a = app_configs_1.default.compatModules) === null || _a === void 0 ? void 0 : _a.exposes) === null || _b === void 0 ? void 0 : _b[moduleName]) {
23
+ if ((_b = (_a = app_configs_1.configs.compatModules) === null || _a === void 0 ? void 0 : _a.exposes) === null || _b === void 0 ? void 0 : _b[moduleName]) {
24
24
  throw new Error(`Модуль ${moduleName} определен как module и как compat. Поменяйте название одного из модулей или удалите его`);
25
25
  }
26
26
  adjustedAssets[moduleName] = {
27
27
  mode: 'default',
28
- js: path_1.default.join(app_configs_1.default.publicPath, modules_1.MODULES_ENTRY_NAME),
28
+ js: path_1.default.join(app_configs_1.configs.publicPath, modules_1.MODULES_ENTRY_NAME),
29
29
  };
30
30
  });
31
31
  const result = Object.assign(Object.assign({}, adjustedAssets), { __metadata__: {
32
- version: app_configs_1.default.version,
33
- name: app_configs_1.default.normalizedName,
32
+ version: app_configs_1.configs.version,
33
+ name: app_configs_1.configs.normalizedName,
34
34
  } });
35
35
  return JSON.stringify(result);
36
36
  }
@@ -39,7 +39,7 @@ function replaceAutoPath(assets) {
39
39
  return assets;
40
40
  }
41
41
  if (Array.isArray(assets)) {
42
- return assets.map((asset) => asset.replace(/^auto\//, app_configs_1.default.publicPath));
42
+ return assets.map((asset) => asset.replace(/^auto\//, app_configs_1.configs.publicPath));
43
43
  }
44
- return assets.replace(/^auto\//, app_configs_1.default.publicPath);
44
+ return assets.replace(/^auto\//, app_configs_1.configs.publicPath);
45
45
  }
@@ -1,11 +1,8 @@
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
3
  exports.serverExternalsExemptions = void 0;
7
- const apply_overrides_1 = __importDefault(require("./util/apply-overrides"));
8
- exports.serverExternalsExemptions = (0, apply_overrides_1.default)('serverExternalsExemptions', [
4
+ const apply_overrides_1 = require("./util/apply-overrides");
5
+ exports.serverExternalsExemptions = (0, apply_overrides_1.applyOverrides)('serverExternalsExemptions', [
9
6
  /^arui-feather/,
10
7
  /^arui-ft-private/,
11
8
  /^arui-private/,
@@ -1,3 +1,2 @@
1
1
  import type { RspackOptionsNormalized } from '@rspack/core';
2
- declare const statsOptions: RspackOptionsNormalized['stats'];
3
- export default statsOptions;
2
+ export declare const statsOptions: RspackOptionsNormalized['stats'];
@@ -1,10 +1,8 @@
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 apply_overrides_1 = __importDefault(require("./util/apply-overrides"));
7
- const statsOptions = (0, apply_overrides_1.default)('stats', {
3
+ exports.statsOptions = void 0;
4
+ const apply_overrides_1 = require("./util/apply-overrides");
5
+ exports.statsOptions = (0, apply_overrides_1.applyOverrides)('stats', {
8
6
  // Add asset Information
9
7
  assets: false,
10
8
  // Add information about cached (not built) modules
@@ -46,4 +44,3 @@ const statsOptions = (0, apply_overrides_1.default)('stats', {
46
44
  // ignore warning from missing types
47
45
  warningsFilter: /export .* was not found in/,
48
46
  });
49
- exports.default = statsOptions;
@@ -1,2 +1 @@
1
- declare const supportingBrowsers: string[];
2
- export default supportingBrowsers;
1
+ export declare const supportingBrowsers: string[];
@@ -1,8 +1,5 @@
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 apply_overrides_1 = __importDefault(require("./util/apply-overrides"));
7
- const supportingBrowsers = (0, apply_overrides_1.default)(['browsers', 'supportingBrowsers'], ['last 2 versions', 'not dead', 'Android >= 6', 'iOS >= 14']);
8
- exports.default = supportingBrowsers;
3
+ exports.supportingBrowsers = void 0;
4
+ const apply_overrides_1 = require("./util/apply-overrides");
5
+ exports.supportingBrowsers = (0, apply_overrides_1.applyOverrides)(['browsers', 'supportingBrowsers'], ['last 2 versions', 'not dead', 'Android >= 6', 'iOS >= 14']);
@@ -1,10 +1,7 @@
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
3
  exports.swcJestConfig = exports.swcServerConfig = exports.swcClientConfig = void 0;
7
- const apply_overrides_1 = __importDefault(require("./util/apply-overrides"));
4
+ const apply_overrides_1 = require("./util/apply-overrides");
8
5
  const app_configs_1 = require("./app-configs");
9
6
  const swcConfig = {
10
7
  env: { coreJs: '3', mode: 'entry' },
@@ -23,13 +20,11 @@ const swcConfig = {
23
20
  },
24
21
  experimental: app_configs_1.configs.collectCoverage
25
22
  ? {
26
- plugins: [
27
- ['swc-plugin-coverage-instrument', {}],
28
- ],
23
+ plugins: [['swc-plugin-coverage-instrument', {}]],
29
24
  }
30
25
  : {},
31
26
  },
32
27
  };
33
- exports.swcClientConfig = (0, apply_overrides_1.default)(['swc', 'swcClient'], swcConfig);
34
- exports.swcServerConfig = (0, apply_overrides_1.default)(['swc', 'swcServer'], swcConfig);
35
- exports.swcJestConfig = (0, apply_overrides_1.default)(['swc', 'swcJest'], swcConfig);
28
+ exports.swcClientConfig = (0, apply_overrides_1.applyOverrides)(['swc', 'swcClient'], swcConfig);
29
+ exports.swcServerConfig = (0, apply_overrides_1.applyOverrides)(['swc', 'swcServer'], swcConfig);
30
+ exports.swcJestConfig = (0, apply_overrides_1.applyOverrides)(['swc', 'swcJest'], swcConfig);
@@ -72,5 +72,5 @@ export type OverrideFile = {
72
72
  * @param args Дополнительные аргументы, которые будут переданы в функцию оверрайда
73
73
  * @returns {*}
74
74
  */
75
- declare function applyOverrides<T extends Overrides[Key], Key extends keyof Overrides, Args = Key extends keyof OverridesAdditionalArgs ? OverridesAdditionalArgs[Key] : undefined>(overridesKey: Key | Key[], config: T, args?: any): T;
76
- export default applyOverrides;
75
+ export declare function applyOverrides<T extends Overrides[Key], Key extends keyof Overrides, Args = Key extends keyof OverridesAdditionalArgs ? OverridesAdditionalArgs[Key] : undefined>(overridesKey: Key | Key[], config: T, args?: any): T;
76
+ export {};
@@ -1,11 +1,9 @@
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 = __importDefault(require("../app-configs"));
3
+ exports.applyOverrides = applyOverrides;
4
+ const app_configs_1 = require("../app-configs");
7
5
  let overrides = [];
8
- overrides = app_configs_1.default.overridesPath.map((path) => {
6
+ overrides = app_configs_1.configs.overridesPath.map((path) => {
9
7
  try {
10
8
  // eslint-disable-next-line import/no-dynamic-require, global-require, @typescript-eslint/no-var-requires
11
9
  const requireResult = require(path);
@@ -36,17 +34,15 @@ function applyOverrides(overridesKey, config, args) {
36
34
  }
37
35
  overridesKey.forEach((key) => {
38
36
  overrides.forEach((override) => {
39
- // eslint-disable-next-line no-prototype-builtins
40
- if (override.hasOwnProperty(key)) {
37
+ if (Object.prototype.hasOwnProperty.call(override, key)) {
41
38
  const overrideFn = override[key];
42
39
  if (typeof overrideFn !== 'function') {
43
40
  throw new TypeError(`Override ${key} must be a function`);
44
41
  }
45
42
  // eslint-disable-next-line no-param-reassign
46
- config = overrideFn(config, app_configs_1.default, args);
43
+ config = overrideFn(config, app_configs_1.configs, args);
47
44
  }
48
45
  });
49
46
  });
50
47
  return config;
51
48
  }
52
- exports.default = applyOverrides;
@@ -1,2 +1 @@
1
- declare function checkNodeVersion(majorVersion: number): boolean;
2
- export default checkNodeVersion;
1
+ export declare function checkNodeVersion(majorVersion: number): boolean;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.checkNodeVersion = checkNodeVersion;
3
4
  function checkNodeVersion(majorVersion) {
4
5
  const actualVersion = process.versions.node.split('.');
5
6
  return parseInt(actualVersion[0], 10) >= majorVersion;
6
7
  }
7
- exports.default = checkNodeVersion;
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.findLoader = findLoader;
4
4
  function findLoader(config, testRule) {
5
- var _a;
6
- for (const rule of config.module.rules) {
5
+ var _a, _b, _c;
6
+ for (const rule of (_b = (_a = config.module) === null || _a === void 0 ? void 0 : _a.rules) !== null && _b !== void 0 ? _b : []) {
7
7
  if (rule === '...' || !rule) {
8
8
  // Webpack имеет странный тип для rules, который позволяет в него положить строку '...'. Успокаиваем TS
9
9
  // eslint-disable-next-line no-continue
@@ -14,7 +14,7 @@ function findLoader(config, testRule) {
14
14
  }
15
15
  if (rule.oneOf) {
16
16
  for (const oneOfRule of rule.oneOf) {
17
- if (oneOfRule && oneOfRule.test && ((_a = oneOfRule === null || oneOfRule === void 0 ? void 0 : oneOfRule.test) === null || _a === void 0 ? void 0 : _a.toString()) === testRule) {
17
+ if (oneOfRule && oneOfRule.test && ((_c = oneOfRule === null || oneOfRule === void 0 ? void 0 : oneOfRule.test) === null || _c === void 0 ? void 0 : _c.toString()) === testRule) {
18
18
  return oneOfRule;
19
19
  }
20
20
  }
@@ -5,5 +5,4 @@ export type Entry = string | string[] | Record<string, string | string[]>;
5
5
  * @param args Дополнительные аргументы, которые будут переданы в getSingleEntry функцию
6
6
  * @returns {*}
7
7
  */
8
- declare function getEntry<AdditionalArgs extends unknown[]>(entryPoint: Entry, getSingleEntry: (entry: string[], ...args: AdditionalArgs) => string[], ...args: AdditionalArgs): string[] | Record<string, string | string[]>;
9
- export default getEntry;
8
+ export declare function getEntry<AdditionalArgs extends unknown[]>(entryPoint: Entry, getSingleEntry: (entry: string[], ...args: AdditionalArgs) => string[], ...args: AdditionalArgs): string[] | Record<string, string | string[]>;
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getEntry = getEntry;
3
4
  /**
4
5
  * @param {string|string[]|object} entryPoint Строка, массив строк или объект с энтрипоинтами
5
6
  * @param {Function} getSingleEntry Функция, возвращающая конфигурацию для одного entryPoint
@@ -19,4 +20,3 @@ function getEntry(entryPoint, getSingleEntry, ...args) {
19
20
  return Object.assign(Object.assign({}, result), { [entryPointName]: entry });
20
21
  }, {});
21
22
  }
22
- exports.default = getEntry;
@@ -1,18 +1,15 @@
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
3
  exports.getWebpackCacheDependencies = getWebpackCacheDependencies;
7
- const app_configs_1 = __importDefault(require("../app-configs"));
4
+ const app_configs_1 = require("../app-configs");
8
5
  const read_config_file_1 = require("../app-configs/read-config-file");
9
6
  const update_with_presets_1 = require("../app-configs/update-with-presets");
10
7
  function getWebpackCacheDependencies() {
11
8
  return {
12
- overrides: app_configs_1.default.overridesPath,
9
+ overrides: app_configs_1.configs.overridesPath,
13
10
  appConfigs: [
14
- (0, read_config_file_1.getConfigFilePath)(app_configs_1.default.cwd),
15
- (0, update_with_presets_1.getPresetsConfigPath)(app_configs_1.default, app_configs_1.default.cwd),
11
+ (0, read_config_file_1.getConfigFilePath)(app_configs_1.configs.cwd),
12
+ (0, update_with_presets_1.getPresetsConfigPath)(app_configs_1.configs, app_configs_1.configs.cwd),
16
13
  ].filter(Boolean),
17
14
  };
18
15
  }
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- // TODO: remove eslint-disable or add override to .eslintrc.js
3
2
  /* eslint-disable global-require */
4
3
  /* eslint-disable import/no-extraneous-dependencies */
5
4
  /* eslint-disable @typescript-eslint/no-var-requires */
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- // TODO: remove eslint-disable
3
2
  /* eslint-disable @typescript-eslint/no-var-requires */
4
3
  // Мы используем ts-node для работы c конфигами, описаными на ts
5
4
  require('ts-node').register({
@@ -1,2 +1 @@
1
- declare const config: import("@rspack/core").RspackOptions | import("@rspack/core").RspackOptions[];
2
- export default config;
1
+ export declare const config: import("@rspack/core").RspackOptions | import("@rspack/core").RspackOptions[];
@@ -1,15 +1,12 @@
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 apply_overrides_1 = __importDefault(require("./util/apply-overrides"));
3
+ exports.config = void 0;
4
+ const apply_overrides_1 = require("./util/apply-overrides");
7
5
  const find_loader_1 = require("./util/find-loader");
8
6
  const find_plugin_1 = require("./util/find-plugin");
9
7
  const webpack_client_1 = require("./webpack.client");
10
- const config = (0, apply_overrides_1.default)(['webpack', 'webpackClient', 'webpackDev', 'webpackClientDev'], (0, webpack_client_1.createClientWebpackConfig)('dev'), {
8
+ exports.config = (0, apply_overrides_1.applyOverrides)(['webpack', 'webpackClient', 'webpackDev', 'webpackClientDev'], (0, webpack_client_1.createClientWebpackConfig)('dev'), {
11
9
  createSingleClientWebpackConfig: webpack_client_1.createSingleClientWebpackConfig.bind(null, 'dev'),
12
10
  findLoader: find_loader_1.findLoader,
13
11
  findPlugin: (0, find_plugin_1.findPlugin)(),
14
12
  });
15
- exports.default = config;
@@ -4,9 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.createClientWebpackConfig = exports.createSingleClientWebpackConfig = void 0;
7
- // TODO: remove eslint-disable and eslint-disable-next-line
8
- /* eslint-disable global-require */
9
- /* eslint-disable @typescript-eslint/no-var-requires */
10
7
  const path_1 = __importDefault(require("path"));
11
8
  const getCSSModuleLocalIdent_1 = __importDefault(require("react-dev-utils/getCSSModuleLocalIdent"));
12
9
  const react_refresh_typescript_1 = __importDefault(require("react-refresh-typescript"));
@@ -15,6 +12,7 @@ const plugin_react_refresh_1 = __importDefault(require("@rspack/plugin-react-ref
15
12
  const assets_webpack_plugin_1 = __importDefault(require("assets-webpack-plugin"));
16
13
  const case_sensitive_paths_webpack_plugin_1 = __importDefault(require("case-sensitive-paths-webpack-plugin"));
17
14
  const compression_webpack_plugin_1 = __importDefault(require("compression-webpack-plugin"));
15
+ const css_minimizer_webpack_plugin_1 = __importDefault(require("css-minimizer-webpack-plugin"));
18
16
  const fork_ts_checker_webpack_plugin_1 = __importDefault(require("fork-ts-checker-webpack-plugin"));
19
17
  const html_webpack_plugin_1 = __importDefault(require("html-webpack-plugin"));
20
18
  const mini_svg_data_uri_1 = __importDefault(require("mini-svg-data-uri"));
@@ -24,17 +22,16 @@ const webpack_deduplication_plugin_1 = require("webpack-deduplication-plugin");
24
22
  const arui_runtime_1 = require("../plugins/arui-runtime");
25
23
  const html_template_1 = require("../templates/html.template");
26
24
  const minimizers_1 = require("./config-extras/minimizers");
27
- const check_node_version_1 = __importDefault(require("./util/check-node-version"));
28
- const get_entry_1 = __importDefault(require("./util/get-entry"));
25
+ const check_node_version_1 = require("./util/check-node-version");
26
+ const get_entry_1 = require("./util/get-entry");
29
27
  const app_configs_1 = require("./app-configs");
30
- const babel_client_1 = __importDefault(require("./babel-client"));
28
+ const babel_client_1 = require("./babel-client");
31
29
  const babel_dependencies_1 = require("./babel-dependencies");
32
30
  const client_env_config_1 = require("./client-env-config");
33
31
  const modules_1 = require("./modules");
34
- const postcss_1 = __importDefault(require("./postcss"));
32
+ const postcss_1 = require("./postcss");
35
33
  const process_assets_plugin_output_1 = require("./process-assets-plugin-output");
36
34
  const swc_1 = require("./swc");
37
- const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
38
35
  const noopPath = require.resolve('./util/noop');
39
36
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
40
37
  function getSingleEntry(entryPoint, mode) {
@@ -99,7 +96,7 @@ function getMinimizeConfig(mode) {
99
96
  // Default number of concurrent runs: os.cpus().length - 1
100
97
  parallel: true,
101
98
  }),
102
- new CssMinimizerPlugin(),
99
+ new css_minimizer_webpack_plugin_1.default(),
103
100
  ].filter(Boolean),
104
101
  };
105
102
  }
@@ -109,11 +106,13 @@ function getMinimizeConfig(mode) {
109
106
  return {
110
107
  minimize: true,
111
108
  minimizer: [
112
- new CssMinimizerPlugin({
109
+ new css_minimizer_webpack_plugin_1.default({
113
110
  minimizerOptions: {
114
- preset: () => ({
111
+ preset: (() => ({
112
+ // eslint-disable-next-line global-require
115
113
  plugins: [require('postcss-discard-duplicates')],
116
- }),
114
+ // некорректные типы у cssMinimizerPlugin
115
+ })), // eslint-disable-line @typescript-eslint/no-explicit-any
117
116
  },
118
117
  }),
119
118
  ],
@@ -131,7 +130,7 @@ function getMinimizeConfig(mode) {
131
130
  * @param configName Имя конфигурации, если не указано, то используется имя по умолчанию
132
131
  */
133
132
  // eslint-disable-next-line complexity
134
- const createSingleClientWebpackConfig = (mode, entry, configName) => (Object.assign(Object.assign({}, (configName ? { name: configName } : {})), { target: 'web', mode: mode === 'dev' ? 'development' : 'production', devtool: mode === 'dev' ? app_configs_1.configs.devSourceMaps : 'source-map', entry: (0, get_entry_1.default)(entry, getSingleEntry, mode),
133
+ const createSingleClientWebpackConfig = (mode, entry, configName) => (Object.assign(Object.assign({}, (configName ? { name: configName } : {})), { target: 'web', mode: mode === 'dev' ? 'development' : 'production', devtool: mode === 'dev' ? app_configs_1.configs.devSourceMaps : 'source-map', entry: (0, get_entry_1.getEntry)(entry, getSingleEntry, mode),
135
134
  // in production mode we need to fail on first error
136
135
  bail: mode === 'prod', context: app_configs_1.configs.cwd, experiments: {
137
136
  css: false,
@@ -222,7 +221,7 @@ const createSingleClientWebpackConfig = (mode, entry, configName) => (Object.ass
222
221
  loader: require.resolve('postcss-loader'),
223
222
  options: {
224
223
  postcssOptions: {
225
- plugins: postcss_1.default,
224
+ plugins: postcss_1.postcssConfig,
226
225
  },
227
226
  },
228
227
  },
@@ -250,7 +249,7 @@ const createSingleClientWebpackConfig = (mode, entry, configName) => (Object.ass
250
249
  loader: require.resolve('postcss-loader'),
251
250
  options: {
252
251
  postcssOptions: {
253
- plugins: postcss_1.default,
252
+ plugins: postcss_1.postcssConfig,
254
253
  },
255
254
  },
256
255
  },
@@ -334,9 +333,7 @@ const createSingleClientWebpackConfig = (mode, entry, configName) => (Object.ass
334
333
  new arui_runtime_1.AruiRuntimePlugin(),
335
334
  app_configs_1.configs.clientOnly &&
336
335
  new html_webpack_plugin_1.default({
337
- templateContent: mode === 'dev'
338
- ? (0, client_env_config_1.addEnvToHtmlTemplate)(html_template_1.htmlTemplate)
339
- : html_template_1.htmlTemplate, // оставляем env шаблоны как есть для прод сборки - их будет менять start.sh
336
+ templateContent: mode === 'dev' ? (0, client_env_config_1.addEnvToHtmlTemplate)(html_template_1.htmlTemplate) : html_template_1.htmlTemplate, // оставляем env шаблоны как есть для прод сборки - их будет менять start.sh
340
337
  filename: '../index.html',
341
338
  }),
342
339
  mode === 'dev' && app_configs_1.configs.clientOnly && new client_env_config_1.ClientConfigPlugin(),
@@ -351,7 +348,7 @@ const createSingleClientWebpackConfig = (mode, entry, configName) => (Object.ass
351
348
  minRatio: 0.8,
352
349
  }),
353
350
  mode === 'prod' &&
354
- (0, check_node_version_1.default)(10) &&
351
+ (0, check_node_version_1.checkNodeVersion)(10) &&
355
352
  new compression_webpack_plugin_1.default({
356
353
  filename: '[file].br',
357
354
  algorithm: 'brotliCompress',
@@ -410,18 +407,13 @@ function getCodeLoader(mode) {
410
407
  };
411
408
  }
412
409
  return {
413
- test: app_configs_1.configs.codeLoader === 'tsc'
414
- ? /\.(js|jsx|mjs|cjs)$/
415
- : /\.(js|jsx|mjs|ts|tsx|cjs)$/,
410
+ test: app_configs_1.configs.codeLoader === 'tsc' ? /\.(js|jsx|mjs|cjs)$/ : /\.(js|jsx|mjs|ts|tsx|cjs)$/,
416
411
  include: app_configs_1.configs.appSrc,
417
412
  loader: require.resolve('babel-loader'),
418
- options: Object.assign(Object.assign({}, babel_client_1.default), { cacheDirectory: mode === 'dev', cacheCompression: false, plugins: [
419
- ...babel_client_1.default.plugins,
413
+ options: Object.assign(Object.assign({}, babel_client_1.babelClientConfig), { cacheDirectory: mode === 'dev', cacheCompression: false, plugins: [
414
+ ...babel_client_1.babelClientConfig.plugins,
420
415
  mode === 'dev'
421
- ? [
422
- require.resolve('react-refresh/babel'),
423
- { skipEnvCheck: true },
424
- ]
416
+ ? [require.resolve('react-refresh/babel'), { skipEnvCheck: true }]
425
417
  : undefined,
426
418
  ].filter(Boolean) }),
427
419
  };
@@ -435,11 +427,8 @@ function getTsLoaderIfEnabled(mode) {
435
427
  use: [
436
428
  {
437
429
  loader: require.resolve('babel-loader'),
438
- options: Object.assign(Object.assign({}, babel_client_1.default), { cacheDirectory: mode === 'dev', cacheCompression: false, plugins: mode === 'dev'
439
- ? [
440
- require.resolve('react-refresh/babel'),
441
- { skipEnvCheck: true },
442
- ]
430
+ options: Object.assign(Object.assign({}, babel_client_1.babelClientConfig), { cacheDirectory: mode === 'dev', cacheCompression: false, plugins: mode === 'dev'
431
+ ? [require.resolve('react-refresh/babel'), { skipEnvCheck: true }]
443
432
  : undefined }),
444
433
  },
445
434
  {
@@ -1,2 +1 @@
1
- declare const config: import("@rspack/core").RspackOptions | import("@rspack/core").RspackOptions[];
2
- export default config;
1
+ export declare const webpackClientConfig: import("@rspack/core").RspackOptions | import("@rspack/core").RspackOptions[];
@@ -1,15 +1,12 @@
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 apply_overrides_1 = __importDefault(require("./util/apply-overrides"));
3
+ exports.webpackClientConfig = void 0;
4
+ const apply_overrides_1 = require("./util/apply-overrides");
7
5
  const find_loader_1 = require("./util/find-loader");
8
6
  const find_plugin_1 = require("./util/find-plugin");
9
7
  const webpack_client_1 = require("./webpack.client");
10
- const config = (0, apply_overrides_1.default)(['webpack', 'webpackClient', 'webpackProd', 'webpackClientProd'], (0, webpack_client_1.createClientWebpackConfig)('prod'), {
8
+ exports.webpackClientConfig = (0, apply_overrides_1.applyOverrides)(['webpack', 'webpackClient', 'webpackProd', 'webpackClientProd'], (0, webpack_client_1.createClientWebpackConfig)('prod'), {
11
9
  createSingleClientWebpackConfig: webpack_client_1.createSingleClientWebpackConfig.bind(null, 'prod'),
12
10
  findLoader: find_loader_1.findLoader,
13
11
  findPlugin: (0, find_plugin_1.findPlugin)(),
14
12
  });
15
- exports.default = config;
@@ -1,2 +1 @@
1
- declare const config: import("@rspack/core").RspackOptions;
2
- export default config;
1
+ export declare const webpackServerConfig: import("@rspack/core").RspackOptions;
@@ -1,11 +1,8 @@
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 apply_overrides_1 = __importDefault(require("./util/apply-overrides"));
3
+ exports.webpackServerConfig = void 0;
4
+ const apply_overrides_1 = require("./util/apply-overrides");
7
5
  const find_loader_1 = require("./util/find-loader");
8
6
  const find_plugin_1 = require("./util/find-plugin");
9
7
  const webpack_server_1 = require("./webpack.server");
10
- const config = (0, apply_overrides_1.default)(['webpack', 'webpackServer', 'webpackDev', 'webpackServerDev'], (0, webpack_server_1.createServerConfig)('dev'), { findLoader: find_loader_1.findLoader, findPlugin: (0, find_plugin_1.findPlugin)() });
11
- exports.default = config;
8
+ exports.webpackServerConfig = (0, apply_overrides_1.applyOverrides)(['webpack', 'webpackServer', 'webpackDev', 'webpackServerDev'], (0, webpack_server_1.createServerConfig)('dev'), { findLoader: find_loader_1.findLoader, findPlugin: (0, find_plugin_1.findPlugin)() });