arui-scripts 15.3.0 → 15.4.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.
Files changed (51) hide show
  1. package/.turbo/turbo-build.log +0 -0
  2. package/.turbo/turbo-test.log +91 -0
  3. package/CHANGELOG.md +278 -656
  4. package/README.md +31 -2
  5. package/bin/build.sh +2 -1
  6. package/build/commands/build/build-wrapper.d.ts +2 -2
  7. package/build/commands/build/client.js +3 -3
  8. package/build/commands/bundle-analyze/index.js +15 -15
  9. package/build/commands/changelog/index.js +2 -2
  10. package/build/commands/util/make-tmp-dir.d.ts +1 -1
  11. package/build/commands/util/make-tmp-dir.js +2 -2
  12. package/build/commands/util/run-client-dev-server.d.ts +1 -1
  13. package/build/commands/util/run-client-dev-server.js +1 -4
  14. package/build/configs/app-configs/calculate-dependent-config.d.ts +54 -8
  15. package/build/configs/app-configs/calculate-dependent-config.js +11 -13
  16. package/build/configs/app-configs/get-defaults.d.ts +3 -2
  17. package/build/configs/app-configs/get-defaults.js +75 -55
  18. package/build/configs/app-configs/index.d.ts +5 -3
  19. package/build/configs/app-configs/index.js +13 -7
  20. package/build/configs/app-configs/types.d.ts +51 -38
  21. package/build/configs/app-configs/update-with-config-file.d.ts +2 -2
  22. package/build/configs/app-configs/update-with-config-file.js +5 -7
  23. package/build/configs/app-configs/update-with-env.js +3 -8
  24. package/build/configs/app-configs/update-with-package.d.ts +2 -2
  25. package/build/configs/app-configs/update-with-package.js +5 -10
  26. package/build/configs/app-configs/update-with-presets.d.ts +2 -2
  27. package/build/configs/app-configs/update-with-presets.js +8 -15
  28. package/build/configs/app-configs/validate-settings-keys.d.ts +2 -5
  29. package/build/configs/app-configs/validate-settings-keys.js +6 -7
  30. package/build/configs/babel-client.d.ts +33 -1
  31. package/build/configs/babel-dependencies.d.ts +14 -1
  32. package/build/configs/babel-server.d.ts +26 -1
  33. package/build/configs/dev-server.d.ts +15 -1
  34. package/build/configs/jest/index.d.ts +33 -1
  35. package/build/configs/postcss.config.d.ts +1 -1
  36. package/build/configs/postcss.d.ts +1 -1
  37. package/build/configs/process-assets-plugin-output.d.ts +2 -0
  38. package/build/configs/process-assets-plugin-output.js +32 -0
  39. package/build/configs/server-externals-exemptions.d.ts +1 -1
  40. package/build/configs/util/apply-overrides.d.ts +23 -7
  41. package/build/configs/util/apply-overrides.js +3 -2
  42. package/build/configs/util/get-entry.d.ts +2 -1
  43. package/build/configs/webpack.client.d.ts +10 -2
  44. package/build/configs/webpack.client.dev.js +1 -1
  45. package/build/configs/webpack.client.js +51 -37
  46. package/build/configs/webpack.client.prod.js +1 -1
  47. package/build/index.d.ts +1 -1
  48. package/build/tsconfig-local.tsbuildinfo +1 -1
  49. package/package.json +4 -4
  50. package/build/configs/app-configs/available-package-settings.d.ts +0 -8
  51. package/build/configs/app-configs/available-package-settings.js +0 -34
@@ -5,20 +5,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.updateWithConfigFile = void 0;
7
7
  const path_1 = __importDefault(require("path"));
8
- const lodash_merge_1 = __importDefault(require("lodash.merge"));
9
8
  const resolve_1 = require("../util/resolve");
10
- const validate_settings_keys_1 = __importDefault(require("./validate-settings-keys"));
11
- const available_package_settings_1 = require("./available-package-settings");
12
- function updateWithConfigFile(config) {
13
- const appConfigPath = (0, resolve_1.tryResolve)(path_1.default.join(config.cwd, '/arui-scripts.config'));
9
+ const validate_settings_keys_1 = require("./validate-settings-keys");
10
+ function updateWithConfigFile(config, context) {
11
+ const appConfigPath = (0, resolve_1.tryResolve)(path_1.default.join(context.cwd, '/arui-scripts.config'));
14
12
  if (appConfigPath) {
15
13
  let appSettings = require(appConfigPath);
16
14
  if (appSettings.__esModule) {
17
15
  // ts-node импортирует esModules, из них надо вытягивать default именно так
18
16
  appSettings = appSettings.default;
19
17
  }
20
- (0, validate_settings_keys_1.default)(available_package_settings_1.availablePackageSettings, appSettings);
21
- config = (0, lodash_merge_1.default)(config, appSettings);
18
+ (0, validate_settings_keys_1.validateSettingsKeys)(config, appSettings, appConfigPath);
19
+ return Object.assign(Object.assign({}, config), appSettings);
22
20
  }
23
21
  return config;
24
22
  }
@@ -1,12 +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.updateWithEnv = void 0;
7
- const lodash_merge_1 = __importDefault(require("lodash.merge"));
8
- const validate_settings_keys_1 = __importDefault(require("./validate-settings-keys"));
9
- const available_package_settings_1 = require("./available-package-settings");
4
+ const validate_settings_keys_1 = require("./validate-settings-keys");
10
5
  function updateWithEnv(config) {
11
6
  if (!process.env.ARUI_SCRIPTS_CONFIG) {
12
7
  return config;
@@ -14,8 +9,8 @@ function updateWithEnv(config) {
14
9
  try {
15
10
  console.warn('Используйте ARUI_SCRIPTS_CONFIG только для отладки');
16
11
  const envSettings = JSON.parse(process.env.ARUI_SCRIPTS_CONFIG);
17
- (0, validate_settings_keys_1.default)(available_package_settings_1.availablePackageSettings, envSettings);
18
- return (0, lodash_merge_1.default)(config, envSettings);
12
+ (0, validate_settings_keys_1.validateSettingsKeys)(config, envSettings, 'ENV');
13
+ return Object.assign(Object.assign({}, config), envSettings);
19
14
  }
20
15
  catch (e) {
21
16
  console.error(e);
@@ -1,2 +1,2 @@
1
- import { AppConfigs } from './types';
2
- export declare function updateWithPackage(config: AppConfigs): any;
1
+ import { AppConfigs, AppContext } from './types';
2
+ export declare function updateWithPackage(config: AppConfigs, context: AppContext): any;
@@ -1,15 +1,10 @@
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.updateWithPackage = void 0;
7
- const lodash_merge_1 = __importDefault(require("lodash.merge"));
8
- const validate_settings_keys_1 = __importDefault(require("./validate-settings-keys"));
9
- const available_package_settings_1 = require("./available-package-settings");
10
- function updateWithPackage(config) {
11
- const packageSettings = config.appPackage.aruiScripts || {};
12
- (0, validate_settings_keys_1.default)(available_package_settings_1.availablePackageSettings, packageSettings);
13
- return (0, lodash_merge_1.default)(config, packageSettings);
4
+ const validate_settings_keys_1 = require("./validate-settings-keys");
5
+ function updateWithPackage(config, context) {
6
+ const packageSettings = context.appPackage.aruiScripts || {};
7
+ (0, validate_settings_keys_1.validateSettingsKeys)(config, packageSettings, 'package.json');
8
+ return Object.assign(Object.assign({}, config), packageSettings);
14
9
  }
15
10
  exports.updateWithPackage = updateWithPackage;
@@ -1,2 +1,2 @@
1
- import { AppConfigs } from './types';
2
- export declare function updateWithPresets(config: AppConfigs): AppConfigs;
1
+ import { AppConfigs, AppContext } from './types';
2
+ export declare function updateWithPresets(config: AppConfigs, context: AppContext): AppConfigs;
@@ -1,33 +1,26 @@
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.updateWithPresets = void 0;
7
- const lodash_merge_1 = __importDefault(require("lodash.merge"));
8
4
  const resolve_1 = require("../util/resolve");
9
- const validate_settings_keys_1 = __importDefault(require("./validate-settings-keys"));
10
- const available_package_settings_1 = require("./available-package-settings");
11
- function updateWithPresets(config) {
12
- const packageSettings = config.appPackage.aruiScripts || {};
13
- if (!packageSettings.presets) {
5
+ const validate_settings_keys_1 = require("./validate-settings-keys");
6
+ function updateWithPresets(config, context) {
7
+ if (!config.presets) {
14
8
  return config;
15
9
  }
16
- const presetsConfigPath = (0, resolve_1.tryResolve)(`${packageSettings.presets}/arui-scripts.config`, { paths: [config.cwd] });
17
- const presetsOverridesPath = (0, resolve_1.tryResolve)(`${packageSettings.presets}/arui-scripts.overrides`, { paths: [config.cwd] });
10
+ const presetsConfigPath = (0, resolve_1.tryResolve)(`${config.presets}/arui-scripts.config`, { paths: [context.cwd] });
11
+ const presetsOverridesPath = (0, resolve_1.tryResolve)(`${config.presets}/arui-scripts.overrides`, { paths: [context.cwd] });
18
12
  if (presetsConfigPath) {
19
13
  let presetsSettings = require(presetsConfigPath);
20
14
  if (presetsSettings.__esModule) {
21
15
  // ts-node импортирует esModules, из них надо вытягивать default именно так
22
16
  presetsSettings = presetsSettings.default;
23
17
  }
24
- (0, validate_settings_keys_1.default)(available_package_settings_1.availablePackageSettings, presetsSettings);
25
- config = (0, lodash_merge_1.default)(config, presetsSettings);
18
+ (0, validate_settings_keys_1.validateSettingsKeys)(config, presetsSettings, presetsConfigPath);
19
+ config = Object.assign(Object.assign({}, config), presetsSettings);
26
20
  }
27
21
  if (presetsOverridesPath) {
28
- config.overridesPath.unshift(presetsOverridesPath);
22
+ context.overridesPath.unshift(presetsOverridesPath);
29
23
  }
30
- delete packageSettings.presets;
31
24
  return config;
32
25
  }
33
26
  exports.updateWithPresets = updateWithPresets;
@@ -1,7 +1,4 @@
1
1
  /**
2
- * Функция проверяет что все ключи объекта settingsObject есть в массиве availableKeys
3
- * @param {string[]} availableKeys Массив допустимых настроек
4
- * @param settingsObject Объект с настройками
2
+ * Функция проверяет что все ключи объекта settingsObject есть в уже существующей конфигурации
5
3
  */
6
- declare function validateSettingsKeys(availableKeys: ReadonlyArray<string>, settingsObject: Record<string, unknown>): void;
7
- export default validateSettingsKeys;
4
+ export declare function validateSettingsKeys(existingConfig: Record<string, unknown>, settingsObject: Record<string, unknown>, source?: string): void;
@@ -1,15 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateSettingsKeys = void 0;
3
4
  /**
4
- * Функция проверяет что все ключи объекта settingsObject есть в массиве availableKeys
5
- * @param {string[]} availableKeys Массив допустимых настроек
6
- * @param settingsObject Объект с настройками
5
+ * Функция проверяет что все ключи объекта settingsObject есть в уже существующей конфигурации
7
6
  */
8
- function validateSettingsKeys(availableKeys, settingsObject) {
7
+ function validateSettingsKeys(existingConfig, settingsObject, source) {
9
8
  Object.keys(settingsObject).forEach((setting) => {
10
- if (!availableKeys.includes(setting)) {
11
- console.warn('\x1b[33m', `Setting`, '\x1b[31m', setting, '\x1b[33m', 'is not supported!');
9
+ if (typeof existingConfig[setting] === 'undefined') {
10
+ console.warn(`Неизвестная настройка "${setting}" в ${source || 'конфигурации'}`);
12
11
  }
13
12
  });
14
13
  }
15
- exports.default = validateSettingsKeys;
14
+ exports.validateSettingsKeys = validateSettingsKeys;
@@ -1,2 +1,34 @@
1
- declare const babelClientConfig: any;
1
+ declare const babelClientConfig: {
2
+ presets: (string | false | (string | {
3
+ targets: {
4
+ browsers: string[];
5
+ };
6
+ loose: boolean;
7
+ useBuiltIns: string;
8
+ corejs: number;
9
+ exclude: string[];
10
+ })[])[];
11
+ plugins: (string | (string | {
12
+ legacy: boolean;
13
+ })[] | (string | {
14
+ loose: boolean;
15
+ })[] | (string | {
16
+ useBuiltIns: boolean;
17
+ })[] | (string | {
18
+ corejs: boolean;
19
+ helpers: boolean;
20
+ version: string;
21
+ regenerator: boolean;
22
+ })[])[];
23
+ env: {
24
+ production: {
25
+ plugins: (string | (string | {
26
+ removeImport: boolean;
27
+ })[])[];
28
+ };
29
+ test: {
30
+ plugins: string[];
31
+ };
32
+ };
33
+ };
2
34
  export default babelClientConfig;
@@ -1 +1,14 @@
1
- export declare const babelDependencies: any;
1
+ export declare const babelDependencies: {
2
+ sourceType: string;
3
+ presets: (string | {
4
+ useBuiltIns: string;
5
+ corejs: number;
6
+ exclude: string[];
7
+ })[][];
8
+ plugins: (string | {
9
+ corejs: boolean;
10
+ helpers: boolean;
11
+ version: string;
12
+ regenerator: boolean;
13
+ })[][];
14
+ };
@@ -1,2 +1,27 @@
1
- declare const config: any;
1
+ declare const config: {
2
+ presets: (string | false | (string | {
3
+ modules: boolean;
4
+ targets: {
5
+ node: string;
6
+ };
7
+ loose: boolean;
8
+ })[])[];
9
+ plugins: (string | (string | {
10
+ legacy: boolean;
11
+ })[] | (string | {
12
+ loose: boolean;
13
+ })[] | (string | {
14
+ useBuiltIns: boolean;
15
+ })[] | (string | {
16
+ helpers: boolean;
17
+ })[])[];
18
+ env: {
19
+ production: {
20
+ plugins: string[];
21
+ };
22
+ test: {
23
+ plugins: string[];
24
+ };
25
+ };
26
+ };
2
27
  export default config;
@@ -1,2 +1,16 @@
1
- declare const devServerConfig: import("webpack-dev-server").Configuration;
1
+ declare const devServerConfig: {
2
+ port: number;
3
+ liveReload: boolean;
4
+ client: {
5
+ overlay: {
6
+ errors: boolean;
7
+ warnings: boolean;
8
+ };
9
+ };
10
+ devMiddleware: {
11
+ publicPath: string;
12
+ };
13
+ static: string[];
14
+ proxy: any;
15
+ };
2
16
  export default devServerConfig;
@@ -13,6 +13,38 @@ export const snapshotSerializers: string[];
13
13
  export const globals: {
14
14
  'ts-jest': {
15
15
  tsconfig: string | null;
16
- babelConfig: any;
16
+ babelConfig: {
17
+ presets: (string | false | (string | {
18
+ targets: {
19
+ browsers: string[];
20
+ };
21
+ loose: boolean;
22
+ useBuiltIns: string;
23
+ corejs: number;
24
+ exclude: string[];
25
+ })[])[];
26
+ plugins: (string | (string | {
27
+ legacy: boolean;
28
+ })[] | (string | {
29
+ loose: boolean;
30
+ })[] | (string | {
31
+ useBuiltIns: boolean;
32
+ })[] | (string | {
33
+ corejs: boolean;
34
+ helpers: boolean;
35
+ version: string;
36
+ regenerator: boolean;
37
+ })[])[];
38
+ env: {
39
+ production: {
40
+ plugins: (string | (string | {
41
+ removeImport: boolean;
42
+ })[])[];
43
+ };
44
+ test: {
45
+ plugins: string[];
46
+ };
47
+ };
48
+ };
17
49
  };
18
50
  };
@@ -4,7 +4,7 @@
4
4
  * @param {Object} options коллекция конфигураций плагинов, где ключ - название плагина, а значение - аргумент для инициализации
5
5
  * @returns {*}
6
6
  */
7
- export declare function createPostcssConfig(plugins: string[], options: Record<string, unknown>): (string | unknown[])[];
7
+ export declare function createPostcssConfig(plugins: string[], options: Record<string, unknown>): string[] | unknown[];
8
8
  export declare const postcssPlugins: string[];
9
9
  export declare const postcssPluginsOptions: {
10
10
  'postcss-import': {
@@ -1,2 +1,2 @@
1
- declare const postcssConfig: any[];
1
+ declare const postcssConfig: string[] | unknown[];
2
2
  export default postcssConfig;
@@ -0,0 +1,2 @@
1
+ import { Assets } from 'assets-webpack-plugin';
2
+ export declare function processAssetsPluginOutput(assets: Assets): string;
@@ -0,0 +1,32 @@
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.processAssetsPluginOutput = void 0;
7
+ const app_configs_1 = __importDefault(require("./app-configs"));
8
+ function processAssetsPluginOutput(assets) {
9
+ let adjustedAssets = assets;
10
+ Object.keys(adjustedAssets).forEach((key) => {
11
+ // заменяем путь к файлам на корректный в случае если в нем есть 'auto/'
12
+ adjustedAssets[key] = {
13
+ css: replaceAutoPath(adjustedAssets[key].css),
14
+ js: replaceAutoPath(adjustedAssets[key].js),
15
+ };
16
+ });
17
+ const result = Object.assign(Object.assign({}, adjustedAssets), { __metadata__: {
18
+ version: app_configs_1.default.version,
19
+ name: app_configs_1.default.normalizedName,
20
+ } });
21
+ return JSON.stringify(result);
22
+ }
23
+ exports.processAssetsPluginOutput = processAssetsPluginOutput;
24
+ function replaceAutoPath(assets) {
25
+ if (!assets) {
26
+ return assets;
27
+ }
28
+ if (Array.isArray(assets)) {
29
+ return assets.map((asset) => asset.replace(/^auto\//, app_configs_1.default.publicPath));
30
+ }
31
+ return assets.replace(/^auto\//, app_configs_1.default.publicPath);
32
+ }
@@ -1 +1 @@
1
- export declare const serverExternalsExemptions: (string | RegExp)[];
1
+ export declare const serverExternalsExemptions: RegExp[];
@@ -1,15 +1,16 @@
1
1
  import type { Configuration as WebpackConfiguration, WebpackOptionsNormalized } from 'webpack';
2
2
  import type { Configuration as WebpackDevServerConfiguration } from 'webpack-dev-server';
3
3
  import { AppConfigs } from '../app-configs/types';
4
+ import { createSingleClientWebpackConfig } from "../webpack.client";
4
5
  type Overrides = {
5
- webpack: WebpackConfiguration;
6
- webpackClient: WebpackConfiguration;
7
- webpackDev: WebpackConfiguration;
8
- webpackClientDev: WebpackConfiguration;
6
+ webpack: WebpackConfiguration | WebpackConfiguration[];
7
+ webpackClient: WebpackConfiguration | WebpackConfiguration[];
8
+ webpackDev: WebpackConfiguration | WebpackConfiguration[];
9
+ webpackClientDev: WebpackConfiguration | WebpackConfiguration[];
9
10
  webpackServer: WebpackConfiguration;
10
11
  webpackServerDev: WebpackConfiguration;
11
12
  webpackProd: WebpackConfiguration;
12
- webpackClientProd: WebpackConfiguration;
13
+ webpackClientProd: WebpackConfiguration | WebpackConfiguration[];
13
14
  webpackServerProd: WebpackConfiguration;
14
15
  devServer: WebpackDevServerConfiguration;
15
16
  stats: WebpackOptionsNormalized['stats'];
@@ -26,7 +27,21 @@ type Overrides = {
26
27
  'start.sh': string;
27
28
  serverExternalsExemptions: Array<string | RegExp>;
28
29
  };
29
- type OverrideFunction<K extends keyof Overrides> = (config: Overrides[K], appConfig: AppConfigs) => Overrides[K];
30
+ type OmitFirstArg<F> = F extends (x: any, ...args: infer P) => infer R ? (...args: P) => R : never;
31
+ type BoundCreateSingleClientWebpackConfig = OmitFirstArg<typeof createSingleClientWebpackConfig>;
32
+ type ClientWebpackAdditionalArgs = {
33
+ createSingleClientWebpackConfig: BoundCreateSingleClientWebpackConfig;
34
+ };
35
+ /**
36
+ * Дополнительные аргументы, которые будут переданы в функцию оверрайда
37
+ */
38
+ type OverridesAdditionalArgs = {
39
+ webpack: ClientWebpackAdditionalArgs;
40
+ webpackClient: ClientWebpackAdditionalArgs;
41
+ webpackDev: ClientWebpackAdditionalArgs;
42
+ webpackClientDev: ClientWebpackAdditionalArgs;
43
+ };
44
+ type OverrideFunction<K extends keyof Overrides, AdditionalArgs = K extends keyof OverridesAdditionalArgs ? OverridesAdditionalArgs[K] : undefined> = (config: Overrides[K], appConfig: AppConfigs, additionalArgs: AdditionalArgs) => Overrides[K];
30
45
  export type OverrideFile = {
31
46
  [K in keyof Overrides]?: OverrideFunction<K>;
32
47
  };
@@ -34,7 +49,8 @@ export type OverrideFile = {
34
49
  *
35
50
  * @param {String|String[]} overridesKey Ключи оверрайда
36
51
  * @param {Object} config Конфиг, к которому нужно применить оверрайды
52
+ * @param args Дополнительные аргументы, которые будут переданы в функцию оверрайда
37
53
  * @returns {*}
38
54
  */
39
- declare function applyOverrides<Key extends keyof Overrides>(overridesKey: Key | Key[], config: Overrides[Key]): Overrides[Key];
55
+ 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;
40
56
  export default applyOverrides;
@@ -24,9 +24,10 @@ overrides = app_configs_1.default.overridesPath.map(path => {
24
24
  *
25
25
  * @param {String|String[]} overridesKey Ключи оверрайда
26
26
  * @param {Object} config Конфиг, к которому нужно применить оверрайды
27
+ * @param args Дополнительные аргументы, которые будут переданы в функцию оверрайда
27
28
  * @returns {*}
28
29
  */
29
- function applyOverrides(overridesKey, config) {
30
+ function applyOverrides(overridesKey, config, args) {
30
31
  if (typeof overridesKey === 'string') {
31
32
  overridesKey = [overridesKey];
32
33
  }
@@ -37,7 +38,7 @@ function applyOverrides(overridesKey, config) {
37
38
  if (typeof overrideFn !== 'function') {
38
39
  throw new TypeError(`Override ${key} must be a function`);
39
40
  }
40
- config = overrideFn(config, app_configs_1.default);
41
+ config = overrideFn(config, app_configs_1.default, args);
41
42
  }
42
43
  });
43
44
  });
@@ -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: string | string[] | Record<string, string | string[]>, getSingleEntry: (entry: string[], ...args: AdditionalArgs) => string[], ...args: AdditionalArgs): string[] | Record<string, string | string[]>;
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,10 @@
1
- import { Configuration } from 'webpack';
2
- export declare const createClientWebpackConfig: (mode: 'dev' | 'prod') => Configuration;
1
+ import webpack, { Configuration } from 'webpack';
2
+ import { Entry } from './util/get-entry';
3
+ /**
4
+ * Создает конфигурацию для сборки клиентского кода. Может быть использована для создания дополнительных конфигураций.
5
+ * @param mode Режим сборки (dev или prod)
6
+ * @param entry Точка входа, любой валидный вход для webpack
7
+ * @param configName Имя конфигурации, если не указано, то используется имя по умолчанию
8
+ */
9
+ export declare const createSingleClientWebpackConfig: (mode: 'dev' | 'prod', entry: Entry, configName?: string) => Configuration;
10
+ export declare const createClientWebpackConfig: (mode: 'dev' | 'prod') => webpack.Configuration;
@@ -5,5 +5,5 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const apply_overrides_1 = __importDefault(require("./util/apply-overrides"));
7
7
  const webpack_client_1 = require("./webpack.client");
8
- const config = (0, apply_overrides_1.default)(['webpack', 'webpackClient', 'webpackDev', 'webpackClientDev'], (0, webpack_client_1.createClientWebpackConfig)('dev'));
8
+ const config = (0, apply_overrides_1.default)(['webpack', 'webpackClient', 'webpackDev', 'webpackClientDev'], (0, webpack_client_1.createClientWebpackConfig)('dev'), { createSingleClientWebpackConfig: webpack_client_1.createSingleClientWebpackConfig.bind(null, 'dev') });
9
9
  exports.default = config;