@nx/webpack 16.8.0-beta.4 → 16.8.0-beta.5

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.
@@ -1,38 +1,35 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.webpackInitSchematic = exports.webpackInitGenerator = void 0;
4
- const tslib_1 = require("tslib");
5
4
  const devkit_1 = require("@nx/devkit");
6
5
  const add_swc_dependencies_1 = require("@nx/js/src/utils/swc/add-swc-dependencies");
7
6
  const versions_1 = require("../../utils/versions");
8
- function webpackInitGenerator(tree, schema) {
9
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
10
- const tasks = [];
11
- const devDependencies = {
12
- '@nx/webpack': versions_1.nxVersion,
13
- };
14
- if (schema.compiler === 'swc') {
15
- devDependencies['swc-loader'] = versions_1.swcLoaderVersion;
16
- const addSwcTask = (0, add_swc_dependencies_1.addSwcDependencies)(tree);
17
- tasks.push(addSwcTask);
18
- }
19
- if (schema.compiler === 'tsc') {
20
- devDependencies['tslib'] = versions_1.tsLibVersion;
21
- }
22
- if (schema.uiFramework === 'react') {
23
- devDependencies['@pmmmwh/react-refresh-webpack-plugin'] =
24
- versions_1.reactRefreshWebpackPluginVersion;
25
- devDependencies['@svgr/webpack'] = versions_1.svgrWebpackVersion;
26
- devDependencies['react-refresh'] = versions_1.reactRefreshVersion;
27
- devDependencies['url-loader'] = versions_1.urlLoaderVersion;
28
- }
29
- if (!schema.skipFormat) {
30
- yield (0, devkit_1.formatFiles)(tree);
31
- }
32
- const baseInstalTask = (0, devkit_1.addDependenciesToPackageJson)(tree, {}, devDependencies);
33
- tasks.push(baseInstalTask);
34
- return (0, devkit_1.runTasksInSerial)(...tasks);
35
- });
7
+ async function webpackInitGenerator(tree, schema) {
8
+ const tasks = [];
9
+ const devDependencies = {
10
+ '@nx/webpack': versions_1.nxVersion,
11
+ };
12
+ if (schema.compiler === 'swc') {
13
+ devDependencies['swc-loader'] = versions_1.swcLoaderVersion;
14
+ const addSwcTask = (0, add_swc_dependencies_1.addSwcDependencies)(tree);
15
+ tasks.push(addSwcTask);
16
+ }
17
+ if (schema.compiler === 'tsc') {
18
+ devDependencies['tslib'] = versions_1.tsLibVersion;
19
+ }
20
+ if (schema.uiFramework === 'react') {
21
+ devDependencies['@pmmmwh/react-refresh-webpack-plugin'] =
22
+ versions_1.reactRefreshWebpackPluginVersion;
23
+ devDependencies['@svgr/webpack'] = versions_1.svgrWebpackVersion;
24
+ devDependencies['react-refresh'] = versions_1.reactRefreshVersion;
25
+ devDependencies['url-loader'] = versions_1.urlLoaderVersion;
26
+ }
27
+ if (!schema.skipFormat) {
28
+ await (0, devkit_1.formatFiles)(tree);
29
+ }
30
+ const baseInstalTask = (0, devkit_1.addDependenciesToPackageJson)(tree, {}, devDependencies);
31
+ tasks.push(baseInstalTask);
32
+ return (0, devkit_1.runTasksInSerial)(...tasks);
36
33
  }
37
34
  exports.webpackInitGenerator = webpackInitGenerator;
38
35
  exports.default = webpackInitGenerator;
@@ -1,12 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
3
  const devkit_1 = require("@nx/devkit");
5
4
  const add_babel_inputs_1 = require("@nx/js/src/utils/add-babel-inputs");
6
- function default_1(tree) {
7
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
8
- (0, add_babel_inputs_1.addBabelInputs)(tree);
9
- yield (0, devkit_1.formatFiles)(tree);
10
- });
5
+ async function default_1(tree) {
6
+ (0, add_babel_inputs_1.addBabelInputs)(tree);
7
+ await (0, devkit_1.formatFiles)(tree);
11
8
  }
12
9
  exports.default = default_1;
@@ -1,24 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
3
  const devkit_1 = require("@nx/devkit");
5
- function default_1(tree) {
6
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
7
- const projects = (0, devkit_1.getProjects)(tree);
8
- projects.forEach((p) => {
9
- let shouldUpdate = false;
10
- Object.entries(p.targets).forEach(([name, config]) => {
11
- var _a, _b, _c, _d, _e, _f;
12
- if (((_b = (_a = p.targets) === null || _a === void 0 ? void 0 : _a[name]) === null || _b === void 0 ? void 0 : _b.executor) === '@nrwl/webpack:webpack' &&
13
- ((_d = (_c = p.targets) === null || _c === void 0 ? void 0 : _c[name]) === null || _d === void 0 ? void 0 : _d.options.es2015Polyfills)) {
14
- (_f = (_e = p.targets) === null || _e === void 0 ? void 0 : _e[name]) === null || _f === void 0 ? true : delete _f.options.es2015Polyfills;
15
- shouldUpdate = true;
16
- }
17
- });
18
- if (shouldUpdate) {
19
- (0, devkit_1.updateProjectConfiguration)(tree, p.name, p);
4
+ async function default_1(tree) {
5
+ const projects = (0, devkit_1.getProjects)(tree);
6
+ projects.forEach((p) => {
7
+ let shouldUpdate = false;
8
+ Object.entries(p.targets).forEach(([name, config]) => {
9
+ if (p.targets?.[name]?.executor === '@nrwl/webpack:webpack' &&
10
+ p.targets?.[name]?.options.es2015Polyfills) {
11
+ delete p.targets?.[name]?.options.es2015Polyfills;
12
+ shouldUpdate = true;
20
13
  }
21
14
  });
15
+ if (shouldUpdate) {
16
+ (0, devkit_1.updateProjectConfiguration)(tree, p.name, p);
17
+ }
22
18
  });
23
19
  }
24
20
  exports.default = default_1;
@@ -1,49 +1,46 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
3
  const devkit_1 = require("@nx/devkit");
5
4
  const executor_options_utils_1 = require("@nx/devkit/src/generators/executor-options-utils");
6
5
  const path_1 = require("path");
7
- function default_1(tree) {
8
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
9
- // Since projects can have multiple configurations, we need to know if the default options
10
- // need to be migrated or not. If so then the subsequent configurations with `webpackConfig` also need to be.
11
- const defaultOptionsUpdated = new Set();
12
- (0, executor_options_utils_1.forEachExecutorOptions)(tree, '@nrwl/webpack:webpack', (options, projectName, targetName, configurationName) => {
13
- var _a;
14
- const projectConfiguration = (0, devkit_1.readProjectConfiguration)(tree, projectName);
15
- const defaultOptions = projectConfiguration.targets[targetName].options;
16
- const defaultWasUpdated = defaultOptionsUpdated.has(projectName);
17
- // If default was not updated (for different configurations), we don't do anything
18
- // If isolatedConfig is set, we don't need to do anything
19
- // If project is React, we don't need to do anything
20
- if (!defaultWasUpdated &&
21
- ((defaultOptions === null || defaultOptions === void 0 ? void 0 : defaultOptions.isolatedConfig) ||
22
- ((_a = defaultOptions === null || defaultOptions === void 0 ? void 0 : defaultOptions.main) === null || _a === void 0 ? void 0 : _a.match(/main\.(t|j)sx$/)) ||
23
- (defaultOptions === null || defaultOptions === void 0 ? void 0 : defaultOptions.webpackConfig) === '@nrwl/react/plugins/webpack')) {
24
- return;
6
+ async function default_1(tree) {
7
+ // Since projects can have multiple configurations, we need to know if the default options
8
+ // need to be migrated or not. If so then the subsequent configurations with `webpackConfig` also need to be.
9
+ const defaultOptionsUpdated = new Set();
10
+ (0, executor_options_utils_1.forEachExecutorOptions)(tree, '@nrwl/webpack:webpack', (options, projectName, targetName, configurationName) => {
11
+ const projectConfiguration = (0, devkit_1.readProjectConfiguration)(tree, projectName);
12
+ const defaultOptions = projectConfiguration.targets[targetName].options;
13
+ const defaultWasUpdated = defaultOptionsUpdated.has(projectName);
14
+ // If default was not updated (for different configurations), we don't do anything
15
+ // If isolatedConfig is set, we don't need to do anything
16
+ // If project is React, we don't need to do anything
17
+ if (!defaultWasUpdated &&
18
+ (defaultOptions?.isolatedConfig ||
19
+ defaultOptions?.main?.match(/main\.(t|j)sx$/) ||
20
+ defaultOptions?.webpackConfig === '@nrwl/react/plugins/webpack')) {
21
+ return;
22
+ }
23
+ defaultOptionsUpdated.add(projectName);
24
+ // If this is not the base options (e.g. for development, production, or something custom),
25
+ // then skip it unless it specifically configures a webpackConfig file
26
+ if (configurationName && !options?.webpackConfig) {
27
+ return;
28
+ }
29
+ // If webpackConfig is set, update it with the new options
30
+ // If webpackConfig is not set, we need to create a new
31
+ // webpack.config.js file and set the path to it in the
32
+ // executor options
33
+ if (options?.webpackConfig) {
34
+ let oldName = options.webpackConfig;
35
+ if (options.webpackConfig.endsWith('.js')) {
36
+ oldName = options.webpackConfig.replace('.js', '.old.js');
25
37
  }
26
- defaultOptionsUpdated.add(projectName);
27
- // If this is not the base options (e.g. for development, production, or something custom),
28
- // then skip it unless it specifically configures a webpackConfig file
29
- if (configurationName && !(options === null || options === void 0 ? void 0 : options.webpackConfig)) {
30
- return;
38
+ if (options.webpackConfig.endsWith('.ts')) {
39
+ oldName = options.webpackConfig.replace('.ts', '.old.ts');
31
40
  }
32
- // If webpackConfig is set, update it with the new options
33
- // If webpackConfig is not set, we need to create a new
34
- // webpack.config.js file and set the path to it in the
35
- // executor options
36
- if (options === null || options === void 0 ? void 0 : options.webpackConfig) {
37
- let oldName = options.webpackConfig;
38
- if (options.webpackConfig.endsWith('.js')) {
39
- oldName = options.webpackConfig.replace('.js', '.old.js');
40
- }
41
- if (options.webpackConfig.endsWith('.ts')) {
42
- oldName = options.webpackConfig.replace('.ts', '.old.ts');
43
- }
44
- renameFile(tree, options.webpackConfig, oldName);
45
- const justTheFileName = (0, path_1.basename)(oldName);
46
- tree.write(options.webpackConfig, `
41
+ renameFile(tree, options.webpackConfig, oldName);
42
+ const justTheFileName = (0, path_1.basename)(oldName);
43
+ tree.write(options.webpackConfig, `
47
44
  const { composePlugins, withNx } = require('@nrwl/webpack');
48
45
 
49
46
  // Nx plugins for webpack.
@@ -55,10 +52,10 @@ function default_1(tree) {
55
52
  return require('./${justTheFileName}')(config, context);
56
53
  });
57
54
  `);
58
- options.isolatedConfig = true;
59
- projectConfiguration.targets[targetName][configurationName !== null && configurationName !== void 0 ? configurationName : 'options'] = options;
60
- (0, devkit_1.updateProjectConfiguration)(tree, projectName, projectConfiguration);
61
- devkit_1.logger.info(`
55
+ options.isolatedConfig = true;
56
+ projectConfiguration.targets[targetName][configurationName ?? 'options'] = options;
57
+ (0, devkit_1.updateProjectConfiguration)(tree, projectName, projectConfiguration);
58
+ devkit_1.logger.info(`
62
59
  ${options.webpackConfig} has been renamed to ${oldName} and a new ${options.webpackConfig}
63
60
  has been created for your project ${projectName}.
64
61
  You should consider inlining the logic from ${oldName} into ${options.webpackConfig}.
@@ -66,15 +63,15 @@ function default_1(tree) {
66
63
 
67
64
  https://nx.dev/recipes/webpack/webpack-config-setup
68
65
  `);
66
+ }
67
+ else {
68
+ const projectConfiguration = (0, devkit_1.readProjectConfiguration)(tree, projectName);
69
+ if (!options) {
70
+ options = {};
69
71
  }
70
- else {
71
- const projectConfiguration = (0, devkit_1.readProjectConfiguration)(tree, projectName);
72
- if (!options) {
73
- options = {};
74
- }
75
- options.webpackConfig = `${projectConfiguration.root}/webpack.config.js`;
76
- options.isolatedConfig = true;
77
- tree.write(options.webpackConfig, `
72
+ options.webpackConfig = `${projectConfiguration.root}/webpack.config.js`;
73
+ options.isolatedConfig = true;
74
+ tree.write(options.webpackConfig, `
78
75
  const { composePlugins, withNx } = require('@nrwl/webpack');
79
76
 
80
77
  // Nx plugins for webpack.
@@ -86,12 +83,11 @@ function default_1(tree) {
86
83
  return config;
87
84
  });
88
85
  `);
89
- projectConfiguration.targets[targetName].options = options;
90
- (0, devkit_1.updateProjectConfiguration)(tree, projectName, projectConfiguration);
91
- }
92
- });
93
- yield (0, devkit_1.formatFiles)(tree);
86
+ projectConfiguration.targets[targetName].options = options;
87
+ (0, devkit_1.updateProjectConfiguration)(tree, projectName, projectConfiguration);
88
+ }
94
89
  });
90
+ await (0, devkit_1.formatFiles)(tree);
95
91
  }
96
92
  exports.default = default_1;
97
93
  function renameFile(tree, from, to) {
@@ -1,20 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
3
  const devkit_1 = require("@nx/devkit");
5
4
  const executor_options_utils_1 = require("@nx/devkit/src/generators/executor-options-utils");
6
- function default_1(tree) {
7
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
8
- (0, executor_options_utils_1.forEachExecutorOptions)(tree, '@nrwl/webpack:webpack', (options, projectName, targetName, _configurationName) => {
9
- if (options.babelUpwardRootMode !== undefined) {
10
- return;
11
- }
12
- const projectConfiguration = (0, devkit_1.readProjectConfiguration)(tree, projectName);
13
- projectConfiguration.targets[targetName].options.babelUpwardRootMode =
14
- true;
15
- (0, devkit_1.updateProjectConfiguration)(tree, projectName, projectConfiguration);
16
- });
17
- yield (0, devkit_1.formatFiles)(tree);
5
+ async function default_1(tree) {
6
+ (0, executor_options_utils_1.forEachExecutorOptions)(tree, '@nrwl/webpack:webpack', (options, projectName, targetName, _configurationName) => {
7
+ if (options.babelUpwardRootMode !== undefined) {
8
+ return;
9
+ }
10
+ const projectConfiguration = (0, devkit_1.readProjectConfiguration)(tree, projectName);
11
+ projectConfiguration.targets[targetName].options.babelUpwardRootMode =
12
+ true;
13
+ (0, devkit_1.updateProjectConfiguration)(tree, projectName, projectConfiguration);
18
14
  });
15
+ await (0, devkit_1.formatFiles)(tree);
19
16
  }
20
17
  exports.default = default_1;
@@ -1,12 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
3
  const devkit_1 = require("@nx/devkit");
5
4
  const replace_package_1 = require("@nx/devkit/src/utils/replace-package");
6
- function replacePackage(tree) {
7
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
8
- yield (0, replace_package_1.replaceNrwlPackageWithNxPackage)(tree, '@nrwl/webpack', '@nx/webpack');
9
- yield (0, devkit_1.formatFiles)(tree);
10
- });
5
+ async function replacePackage(tree) {
6
+ await (0, replace_package_1.replaceNrwlPackageWithNxPackage)(tree, '@nrwl/webpack', '@nx/webpack');
7
+ await (0, devkit_1.formatFiles)(tree);
11
8
  }
12
9
  exports.default = replacePackage;
@@ -18,7 +18,6 @@ class GeneratePackageJsonPlugin {
18
18
  name: pluginName,
19
19
  stage: compiler.webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL,
20
20
  }, () => {
21
- var _a;
22
21
  const helperDependencies = (0, js_2.getHelperDependenciesFromProjectGraph)(this.context.root, this.context.projectName, this.projectGraph);
23
22
  const importHelpers = !!(0, js_2.readTsConfig)(this.options.tsConfig).options
24
23
  .importHelpers;
@@ -37,7 +36,7 @@ class GeneratePackageJsonPlugin {
37
36
  isProduction: true,
38
37
  helperDependencies: helperDependencies.map((dep) => dep.target),
39
38
  });
40
- packageJson.main = (_a = packageJson.main) !== null && _a !== void 0 ? _a : this.options.outputFileName;
39
+ packageJson.main = packageJson.main ?? this.options.outputFileName;
41
40
  compilation.emitAsset('package.json', new webpack_1.sources.RawSource((0, devkit_1.serializeJson)(packageJson)));
42
41
  const packageManager = (0, devkit_1.detectPackageManager)(this.context.root);
43
42
  compilation.emitAsset((0, js_2.getLockFileName)(packageManager), new webpack_1.sources.RawSource((0, js_1.createLockFile)(packageJson, this.projectGraph, packageManager)));
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.WebpackNxBuildCoordinationPlugin = void 0;
4
- const tslib_1 = require("tslib");
5
4
  const child_process_1 = require("child_process");
6
5
  const client_1 = require("nx/src/daemon/client/client");
7
6
  const watch_1 = require("nx/src/command-line/watch");
@@ -17,48 +16,44 @@ class WebpackNxBuildCoordinationPlugin {
17
16
  this.startWatchingBuildableLibs();
18
17
  }
19
18
  apply(compiler) {
20
- compiler.hooks.beforeCompile.tapPromise('IncrementalDevServerPlugin', () => tslib_1.__awaiter(this, void 0, void 0, function* () {
19
+ compiler.hooks.beforeCompile.tapPromise('IncrementalDevServerPlugin', async () => {
21
20
  while (this.currentlyRunning === 'nx-build') {
22
- yield sleep(50);
21
+ await sleep(50);
23
22
  }
24
23
  this.currentlyRunning = 'webpack-build';
25
- }));
26
- compiler.hooks.done.tapPromise('IncrementalDevServerPlugin', () => tslib_1.__awaiter(this, void 0, void 0, function* () {
24
+ });
25
+ compiler.hooks.done.tapPromise('IncrementalDevServerPlugin', async () => {
27
26
  this.currentlyRunning = 'none';
28
- }));
27
+ });
29
28
  }
30
- startWatchingBuildableLibs() {
31
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
32
- const unregisterFileWatcher = yield this.createFileWatcher();
33
- process.on('exit', () => {
34
- unregisterFileWatcher();
35
- });
29
+ async startWatchingBuildableLibs() {
30
+ const unregisterFileWatcher = await this.createFileWatcher();
31
+ process.on('exit', () => {
32
+ unregisterFileWatcher();
36
33
  });
37
34
  }
38
- buildChangedProjects() {
39
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
40
- while (this.currentlyRunning === 'webpack-build') {
41
- yield sleep(50);
42
- }
43
- this.currentlyRunning = 'nx-build';
44
- try {
45
- return yield new Promise((res) => {
46
- this.buildCmdProcess = (0, child_process_1.exec)(this.buildCmd);
47
- this.buildCmdProcess.stdout.pipe(process.stdout);
48
- this.buildCmdProcess.stderr.pipe(process.stderr);
49
- this.buildCmdProcess.on('exit', () => {
50
- res();
51
- });
52
- this.buildCmdProcess.on('error', () => {
53
- res();
54
- });
35
+ async buildChangedProjects() {
36
+ while (this.currentlyRunning === 'webpack-build') {
37
+ await sleep(50);
38
+ }
39
+ this.currentlyRunning = 'nx-build';
40
+ try {
41
+ return await new Promise((res) => {
42
+ this.buildCmdProcess = (0, child_process_1.exec)(this.buildCmd);
43
+ this.buildCmdProcess.stdout.pipe(process.stdout);
44
+ this.buildCmdProcess.stderr.pipe(process.stderr);
45
+ this.buildCmdProcess.on('exit', () => {
46
+ res();
55
47
  });
56
- }
57
- finally {
58
- this.currentlyRunning = 'none';
59
- this.buildCmdProcess = null;
60
- }
61
- });
48
+ this.buildCmdProcess.on('error', () => {
49
+ res();
50
+ });
51
+ });
52
+ }
53
+ finally {
54
+ this.currentlyRunning = 'none';
55
+ this.buildCmdProcess = null;
56
+ }
62
57
  }
63
58
  createFileWatcher() {
64
59
  const runner = new watch_1.BatchFunctionRunner(() => this.buildChangedProjects());
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.composePluginsSync = exports.composePlugins = exports.getBaseWebpackPartial = void 0;
4
- const tslib_1 = require("tslib");
5
4
  const with_nx_1 = require("./with-nx");
6
5
  const with_web_1 = require("./with-web");
7
6
  /** @deprecated use withNx and withWeb plugins directly */
@@ -12,14 +11,12 @@ function getBaseWebpackPartial(options, context) {
12
11
  }
13
12
  exports.getBaseWebpackPartial = getBaseWebpackPartial;
14
13
  function composePlugins(...plugins) {
15
- return function combined(config, ctx) {
16
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
17
- for (const plugin of plugins) {
18
- const fn = yield plugin;
19
- config = yield fn(config, ctx);
20
- }
21
- return config;
22
- });
14
+ return async function combined(config, ctx) {
15
+ for (const plugin of plugins) {
16
+ const fn = await plugin;
17
+ config = await fn(config, ctx);
18
+ }
19
+ return config;
23
20
  };
24
21
  }
25
22
  exports.composePlugins = composePlugins;
@@ -5,7 +5,6 @@ const CopyWebpackPlugin = require("copy-webpack-plugin");
5
5
  function createCopyPlugin(assets) {
6
6
  return new CopyWebpackPlugin({
7
7
  patterns: assets.map((asset) => {
8
- var _a;
9
8
  return {
10
9
  context: asset.input,
11
10
  // Now we remove starting slash to make Webpack place it from the output root.
@@ -16,7 +15,7 @@ function createCopyPlugin(assets) {
16
15
  '.gitkeep',
17
16
  '**/.DS_Store',
18
17
  '**/Thumbs.db',
19
- ...((_a = asset.ignore) !== null && _a !== void 0 ? _a : []),
18
+ ...(asset.ignore ?? []),
20
19
  ],
21
20
  dot: true,
22
21
  },
@@ -1,18 +1,6 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
1
  module.exports = require('babel-loader').custom(() => {
13
2
  return {
14
- customOptions(_a) {
15
- var { isTest, isModern, emitDecoratorMetadata } = _a, loader = __rest(_a, ["isTest", "isModern", "emitDecoratorMetadata"]);
3
+ customOptions({ isTest, isModern, emitDecoratorMetadata, ...loader }) {
16
4
  return {
17
5
  custom: { isTest, isModern, emitDecoratorMetadata },
18
6
  loader,
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.normalizeExtraEntryPoints = void 0;
4
- const tslib_1 = require("tslib");
5
4
  function normalizeExtraEntryPoints(extraEntryPoints, defaultBundleName) {
6
5
  return extraEntryPoints.map((entry) => {
7
6
  let normalizedEntry;
@@ -13,7 +12,7 @@ function normalizeExtraEntryPoints(extraEntryPoints, defaultBundleName) {
13
12
  };
14
13
  }
15
14
  else {
16
- const { inject = true } = entry, newEntry = tslib_1.__rest(entry, ["inject"]);
15
+ const { inject = true, ...newEntry } = entry;
17
16
  let bundleName;
18
17
  if (entry.bundleName) {
19
18
  bundleName = entry.bundleName;
@@ -21,7 +20,7 @@ function normalizeExtraEntryPoints(extraEntryPoints, defaultBundleName) {
21
20
  else {
22
21
  bundleName = defaultBundleName;
23
22
  }
24
- normalizedEntry = Object.assign(Object.assign({}, newEntry), { bundleName });
23
+ normalizedEntry = { ...newEntry, bundleName };
25
24
  }
26
25
  return normalizedEntry;
27
26
  });
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PostcssCliResources = void 0;
4
- const tslib_1 = require("tslib");
5
4
  const loader_utils_1 = require("loader-utils");
6
5
  const path = require("path");
7
6
  const url = require("node:url");
@@ -16,21 +15,19 @@ function wrapUrl(url) {
16
15
  }
17
16
  return `url(${wrappedUrl})`;
18
17
  }
19
- function resolve(file, base, resolver) {
20
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
21
- try {
22
- return yield resolver(`./${file}`, base);
23
- }
24
- catch (_a) {
25
- return resolver(file, base);
26
- }
27
- });
18
+ async function resolve(file, base, resolver) {
19
+ try {
20
+ return await resolver(`./${file}`, base);
21
+ }
22
+ catch {
23
+ return resolver(file, base);
24
+ }
28
25
  }
29
26
  module.exports.postcss = true;
30
27
  function PostcssCliResources(options) {
31
28
  const { deployUrl = '', baseHref = '', resourcesOutputPath = '', rebaseRootRelative = false, filename, loader, } = options;
32
29
  const dedupeSlashes = (url) => url.replace(/\/\/+/g, '/');
33
- const process = (inputUrl, context, resourceCache) => tslib_1.__awaiter(this, void 0, void 0, function* () {
30
+ const process = async (inputUrl, context, resourceCache) => {
34
31
  // If root-relative, absolute or protocol relative url, leave as is
35
32
  if (/^((?:\w+:)?\/\/|data:|chrome:|#)/.test(inputUrl)) {
36
33
  return inputUrl;
@@ -80,7 +77,7 @@ function PostcssCliResources(options) {
80
77
  resolve(result);
81
78
  });
82
79
  });
83
- const result = yield resolve(pathname, context, resolver);
80
+ const result = await resolve(pathname, context, resolver);
84
81
  return new Promise((resolve, reject) => {
85
82
  loader.fs.readFile(result, (err, content) => {
86
83
  if (err) {
@@ -105,7 +102,7 @@ function PostcssCliResources(options) {
105
102
  resolve(outputUrl);
106
103
  });
107
104
  });
108
- });
105
+ };
109
106
  return {
110
107
  postcssPlugin: 'postcss-cli-resources',
111
108
  Once(root) {
@@ -123,7 +120,7 @@ function PostcssCliResources(options) {
123
120
  return;
124
121
  }
125
122
  const resourceCache = new Map();
126
- return Promise.all(urlDeclarations.map((decl) => tslib_1.__awaiter(this, void 0, void 0, function* () {
123
+ return Promise.all(urlDeclarations.map(async (decl) => {
127
124
  const value = decl.value;
128
125
  const urlRegex = /url\(\s*(?:"([^"]+)"|'([^']+)'|(.+?))\s*\)/g;
129
126
  const segments = [];
@@ -138,7 +135,7 @@ function PostcssCliResources(options) {
138
135
  const originalUrl = match[1] || match[2] || match[3];
139
136
  let processedUrl;
140
137
  try {
141
- processedUrl = yield process(originalUrl, context, resourceCache);
138
+ processedUrl = await process(originalUrl, context, resourceCache);
142
139
  }
143
140
  catch (err) {
144
141
  loader.emitError(decl.error(err.message, { word: originalUrl }));
@@ -162,7 +159,7 @@ function PostcssCliResources(options) {
162
159
  if (modified) {
163
160
  decl.value = segments.join('');
164
161
  }
165
- })));
162
+ }));
166
163
  },
167
164
  };
168
165
  }
@@ -21,13 +21,12 @@ class ScriptsWebpackPlugin {
21
21
  this.options = options;
22
22
  }
23
23
  shouldSkip(compilation, scripts) {
24
- var _a;
25
24
  if (this._lastBuildTime == undefined) {
26
25
  this._lastBuildTime = Date.now();
27
26
  return false;
28
27
  }
29
28
  for (let i = 0; i < scripts.length; i++) {
30
- const scriptTime = (_a = compilation.fileTimestamps) === null || _a === void 0 ? void 0 : _a.get(scripts[i]);
29
+ const scriptTime = compilation.fileTimestamps?.get(scripts[i]);
31
30
  if (!scriptTime || scriptTime > this._lastBuildTime) {
32
31
  this._lastBuildTime = Date.now();
33
32
  return false;