@nx/webpack 23.0.0-beta.0 → 23.0.0-beta.10
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/package.json +10 -10
- package/src/executors/dev-server/dev-server.impl.d.ts.map +1 -1
- package/src/executors/dev-server/dev-server.impl.js +4 -2
- package/src/executors/dev-server/schema.json +1 -0
- package/src/executors/ssr-dev-server/ssr-dev-server.impl.d.ts.map +1 -1
- package/src/executors/ssr-dev-server/ssr-dev-server.impl.js +2 -2
- package/src/executors/webpack/schema.json +1 -0
- package/src/executors/webpack/webpack.impl.d.ts.map +1 -1
- package/src/executors/webpack/webpack.impl.js +4 -2
- package/src/generators/configuration/configuration.d.ts.map +1 -1
- package/src/generators/configuration/configuration.js +7 -2
- package/src/generators/convert-config-to-webpack-plugin/convert-config-to-webpack-plugin.d.ts.map +1 -1
- package/src/generators/convert-config-to-webpack-plugin/convert-config-to-webpack-plugin.js +2 -2
- package/src/generators/convert-to-inferred/convert-to-inferred.d.ts.map +1 -1
- package/src/generators/convert-to-inferred/convert-to-inferred.js +4 -5
- package/src/generators/convert-to-inferred/utils/build-post-target-transformer.js +8 -8
- package/src/generators/convert-to-inferred/utils/serve-post-target-transformer.d.ts.map +1 -1
- package/src/generators/convert-to-inferred/utils/serve-post-target-transformer.js +4 -4
- package/src/generators/convert-to-inferred/utils/types.d.ts +1 -1
- package/src/generators/convert-to-inferred/utils/types.d.ts.map +1 -1
- package/src/generators/init/init.d.ts.map +1 -1
- package/src/generators/init/init.js +2 -2
- package/src/migrations/update-21-0-0/remove-isolated-config.d.ts.map +1 -1
- package/src/migrations/update-21-0-0/remove-isolated-config.js +2 -2
- package/src/plugins/nx-webpack-plugin/lib/apply-web-config.d.ts.map +1 -1
- package/src/plugins/nx-webpack-plugin/lib/apply-web-config.js +3 -3
- package/src/plugins/plugin.d.ts.map +1 -1
- package/src/plugins/plugin.js +16 -17
- package/src/utils/deprecation.d.ts +6 -0
- package/src/utils/deprecation.d.ts.map +1 -0
- package/src/utils/deprecation.js +25 -0
- package/src/utils/e2e-web-server-info-utils.d.ts +1 -1
- package/src/utils/e2e-web-server-info-utils.d.ts.map +1 -1
- package/src/utils/e2e-web-server-info-utils.js +2 -2
- package/src/utils/webpack/deprecated-less-loader.js +19 -0
- package/src/utils/webpack/resolve-user-defined-webpack-config.js +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/webpack",
|
|
3
|
-
"version": "23.0.0-beta.
|
|
3
|
+
"version": "23.0.0-beta.10",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Nx Plugin for Webpack contains executors and generators that support building applications using Webpack.",
|
|
6
6
|
"repository": {
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/core": "^7.23.2",
|
|
35
|
-
"@phenomnomnominal/tsquery": "~6.
|
|
36
|
-
"ajv": "^8.
|
|
35
|
+
"@phenomnomnominal/tsquery": "~6.2.0",
|
|
36
|
+
"ajv": "^8.0.0",
|
|
37
37
|
"autoprefixer": "^10.4.9",
|
|
38
38
|
"babel-loader": "^9.1.2",
|
|
39
39
|
"browserslist": "^4.26.0",
|
|
@@ -50,11 +50,11 @@
|
|
|
50
50
|
"parse5": "4.0.0",
|
|
51
51
|
"postcss": "^8.4.38",
|
|
52
52
|
"postcss-import": "~14.1.0",
|
|
53
|
-
"postcss-loader": "^8.
|
|
53
|
+
"postcss-loader": "^8.1.1",
|
|
54
54
|
"rxjs": "^7.8.0",
|
|
55
|
-
"sass": "^1.
|
|
56
|
-
"sass-embedded": "^1.
|
|
57
|
-
"sass-loader": "^16.0.
|
|
55
|
+
"sass": "^1.97.2",
|
|
56
|
+
"sass-embedded": "^1.97.2",
|
|
57
|
+
"sass-loader": "^16.0.7",
|
|
58
58
|
"source-map-loader": "^5.0.0",
|
|
59
59
|
"style-loader": "^3.3.0",
|
|
60
60
|
"terser-webpack-plugin": "^5.3.3",
|
|
@@ -65,11 +65,11 @@
|
|
|
65
65
|
"webpack-dev-server": "^5.2.1",
|
|
66
66
|
"webpack-node-externals": "^3.0.0",
|
|
67
67
|
"webpack-subresource-integrity": "^5.1.0",
|
|
68
|
-
"@nx/devkit": "23.0.0-beta.
|
|
69
|
-
"@nx/js": "23.0.0-beta.
|
|
68
|
+
"@nx/devkit": "23.0.0-beta.10",
|
|
69
|
+
"@nx/js": "23.0.0-beta.10"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
|
-
"nx": "23.0.0-beta.
|
|
72
|
+
"nx": "23.0.0-beta.10"
|
|
73
73
|
},
|
|
74
74
|
"publishConfig": {
|
|
75
75
|
"access": "public"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev-server.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/webpack/src/executors/dev-server/dev-server.impl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dev-server.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/webpack/src/executors/dev-server/dev-server.impl.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,eAAe,EAGhB,MAAM,YAAY,CAAC;AAepB,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAI/C,wBAAuB,iBAAiB,CACtC,YAAY,EAAE,mBAAmB,EACjC,OAAO,EAAE,eAAe;;;aAsGzB;AA0BD,eAAe,iBAAiB,CAAC"}
|
|
@@ -2,19 +2,21 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.devServerExecutor = devServerExecutor;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
5
6
|
const webpack_1 = tslib_1.__importDefault(require("webpack"));
|
|
6
7
|
const devkit_1 = require("@nx/devkit");
|
|
7
|
-
const rxjs_for_await_1 = require("@nx/devkit/src/utils/rxjs-for-await");
|
|
8
8
|
const operators_1 = require("rxjs/operators");
|
|
9
9
|
const webpack_dev_server_1 = tslib_1.__importDefault(require("webpack-dev-server"));
|
|
10
10
|
const get_dev_server_config_1 = require("./lib/get-dev-server-config");
|
|
11
11
|
const buildable_libs_utils_1 = require("@nx/js/src/utils/buildable-libs-utils");
|
|
12
12
|
const run_webpack_1 = require("../../utils/run-webpack");
|
|
13
13
|
const resolve_user_defined_webpack_config_1 = require("../../utils/webpack/resolve-user-defined-webpack-config");
|
|
14
|
+
const deprecation_1 = require("../../utils/deprecation");
|
|
14
15
|
const normalize_options_1 = require("../webpack/lib/normalize-options");
|
|
15
16
|
const config_1 = require("../../utils/config");
|
|
16
17
|
const js_1 = require("@nx/js");
|
|
17
18
|
async function* devServerExecutor(serveOptions, context) {
|
|
19
|
+
(0, deprecation_1.warnWebpackDevServerExecutorDeprecation)();
|
|
18
20
|
// Default to dev mode so builds are faster and HMR mode works better.
|
|
19
21
|
process.env.NODE_ENV ??= 'development';
|
|
20
22
|
const { root: projectRoot, sourceRoot } = context.projectsConfigurations.projects[context.projectName];
|
|
@@ -61,7 +63,7 @@ async function* devServerExecutor(serveOptions, context) {
|
|
|
61
63
|
config.devServer ??= devServer;
|
|
62
64
|
}
|
|
63
65
|
}
|
|
64
|
-
return yield* (0,
|
|
66
|
+
return yield* (0, internal_1.eachValueFrom)((0, run_webpack_1.runWebpackDevServer)(config, webpack_1.default, webpack_dev_server_1.default).pipe((0, operators_1.tap)(({ stats }) => {
|
|
65
67
|
console.info(stats.toString(config.stats));
|
|
66
68
|
}), (0, operators_1.map)(({ baseUrl, stats }) => {
|
|
67
69
|
return {
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
"description": "Serve an application using webpack.",
|
|
7
7
|
"cli": "nx",
|
|
8
8
|
"type": "object",
|
|
9
|
+
"x-deprecated": "The `@nx/webpack:dev-server` executor is deprecated and will be removed in Nx v24. Run `nx g @nx/webpack:convert-to-inferred` to migrate to the `@nx/webpack/plugin` inferred plugin. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.",
|
|
9
10
|
"properties": {
|
|
10
11
|
"buildTarget": {
|
|
11
12
|
"type": "string",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssr-dev-server.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/webpack/src/executors/ssr-dev-server/ssr-dev-server.impl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ssr-dev-server.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/webpack/src/executors/ssr-dev-server/ssr-dev-server.impl.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EAIhB,MAAM,YAAY,CAAC;AAIpB,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAGjE,wBAAuB,oBAAoB,CACzC,OAAO,EAAE,sBAAsB,EAC/B,OAAO,EAAE,eAAe;;aA0Bb,OAAO;aAEP,aAAa;kBA6BzB;AAED,eAAe,oBAAoB,CAAC"}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ssrDevServerExecutor = ssrDevServerExecutor;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
5
6
|
const devkit_1 = require("@nx/devkit");
|
|
6
7
|
const pc = tslib_1.__importStar(require("picocolors"));
|
|
7
|
-
const async_iterable_1 = require("@nx/devkit/src/utils/async-iterable");
|
|
8
8
|
const wait_until_server_is_listening_1 = require("./lib/wait-until-server-is-listening");
|
|
9
9
|
async function* ssrDevServerExecutor(options, context) {
|
|
10
10
|
const browserTarget = (0, devkit_1.parseTargetString)(options.browserTarget, context.projectGraph);
|
|
@@ -15,7 +15,7 @@ async function* ssrDevServerExecutor(options, context) {
|
|
|
15
15
|
const runServer = await (0, devkit_1.runExecutor)(serverTarget, { ...serverOptions, ...options.serverTargetOptions }, context);
|
|
16
16
|
let browserBuilt = false;
|
|
17
17
|
let nodeStarted = false;
|
|
18
|
-
const combined = (0,
|
|
18
|
+
const combined = (0, internal_1.combineAsyncIterables)(runBrowser, runServer);
|
|
19
19
|
for await (const output of combined) {
|
|
20
20
|
if (!output.success)
|
|
21
21
|
throw new Error('Could not build application');
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
"description": "Build a project using webpack.",
|
|
6
6
|
"cli": "nx",
|
|
7
7
|
"type": "object",
|
|
8
|
+
"x-deprecated": "The `@nx/webpack:webpack` executor is deprecated and will be removed in Nx v24. Run `nx g @nx/webpack:convert-to-inferred` to migrate to the `@nx/webpack/plugin` inferred plugin. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.",
|
|
8
9
|
"properties": {
|
|
9
10
|
"crossOrigin": {
|
|
10
11
|
"type": "string",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webpack.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/webpack/src/executors/webpack/webpack.impl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"webpack.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/webpack/src/executors/webpack/webpack.impl.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EAIhB,MAAM,YAAY,CAAC;AAkBpB,OAAO,KAAK,EAEV,sBAAsB,EACvB,MAAM,UAAU,CAAC;AA6ClB,MAAM,MAAM,oBAAoB,GAC5B;IACE,OAAO,EAAE,KAAK,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,sBAAsB,CAAC;CAClC,GACD;IACE,OAAO,EAAE,IAAI,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,sBAAsB,CAAC;CAClC,CAAC;AAEN,wBAAuB,eAAe,CACpC,QAAQ,EAAE,sBAAsB,EAChC,OAAO,EAAE,eAAe,GACvB,cAAc,CAAC,oBAAoB,EAAE,oBAAoB,EAAE,SAAS,CAAC,CA+FvE;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.webpackExecutor = webpackExecutor;
|
|
4
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
4
5
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const rxjs_for_await_1 = require("@nx/devkit/src/utils/rxjs-for-await");
|
|
6
6
|
const js_1 = require("@nx/js");
|
|
7
7
|
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
8
8
|
const path_1 = require("path");
|
|
@@ -10,6 +10,7 @@ const rxjs_1 = require("rxjs");
|
|
|
10
10
|
const operators_1 = require("rxjs/operators");
|
|
11
11
|
const config_1 = require("../../utils/config");
|
|
12
12
|
const resolve_user_defined_webpack_config_1 = require("../../utils/webpack/resolve-user-defined-webpack-config");
|
|
13
|
+
const deprecation_1 = require("../../utils/deprecation");
|
|
13
14
|
const normalize_options_1 = require("./lib/normalize-options");
|
|
14
15
|
const run_webpack_1 = require("./lib/run-webpack");
|
|
15
16
|
async function getWebpackConfigs(options, context) {
|
|
@@ -46,6 +47,7 @@ async function getWebpackConfigs(options, context) {
|
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
async function* webpackExecutor(_options, context) {
|
|
50
|
+
(0, deprecation_1.warnWebpackExecutorDeprecation)();
|
|
49
51
|
// Default to production build.
|
|
50
52
|
process.env['NODE_ENV'] ||= 'production';
|
|
51
53
|
const metadata = context.projectsConfigurations.projects[context.projectName];
|
|
@@ -83,7 +85,7 @@ async function* webpackExecutor(_options, context) {
|
|
|
83
85
|
For libraries, configure the project to use the '@nx/dependency-checks' ESLint rule instead (https://nx.dev/nx-api/eslint-plugin/documents/dependency-checks).`);
|
|
84
86
|
}
|
|
85
87
|
const configs = await getWebpackConfigs(options, context);
|
|
86
|
-
return yield* (0,
|
|
88
|
+
return yield* (0, internal_1.eachValueFrom)((0, rxjs_1.of)(configs).pipe((0, operators_1.mergeMap)((config) => (Array.isArray(config) ? (0, rxjs_1.from)(config) : (0, rxjs_1.of)(config))),
|
|
87
89
|
// Run build sequentially and bail when first one fails.
|
|
88
90
|
(0, operators_1.mergeScan)((acc, config) => {
|
|
89
91
|
if (!acc.hasErrors()) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../../../../packages/webpack/src/generators/configuration/configuration.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../../../../packages/webpack/src/generators/configuration/configuration.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,iBAAiB,EAMjB,IAAI,EAGL,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAOxD,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,4BAA4B,8BAGtC;AAED,wBAAsB,8BAA8B,CAClD,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,4BAA4B,8BAqCtC;AA6LD,eAAe,sBAAsB,CAAC"}
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.configurationGenerator = configurationGenerator;
|
|
4
4
|
exports.configurationGeneratorInternal = configurationGeneratorInternal;
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
5
6
|
const devkit_1 = require("@nx/devkit");
|
|
6
7
|
const init_1 = require("../init/init");
|
|
7
8
|
const has_plugin_1 = require("../../utils/has-plugin");
|
|
8
|
-
const
|
|
9
|
+
const deprecation_1 = require("../../utils/deprecation");
|
|
10
|
+
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
9
11
|
const ensure_dependencies_1 = require("../../utils/ensure-dependencies");
|
|
10
12
|
function configurationGenerator(tree, options) {
|
|
11
13
|
return configurationGeneratorInternal(tree, { addPlugin: false, ...options });
|
|
@@ -27,6 +29,7 @@ async function configurationGeneratorInternal(tree, options) {
|
|
|
27
29
|
tasks.push(depsTask);
|
|
28
30
|
checkForTargetConflicts(tree, options);
|
|
29
31
|
if (!(0, has_plugin_1.hasPlugin)(tree)) {
|
|
32
|
+
(0, deprecation_1.warnWebpackExecutorGenerating)();
|
|
30
33
|
addBuildTarget(tree, options);
|
|
31
34
|
if (options.devServer) {
|
|
32
35
|
addServeTarget(tree, options);
|
|
@@ -127,7 +130,9 @@ module.exports = composePlugins(withNx(), (config) => {
|
|
|
127
130
|
}
|
|
128
131
|
}
|
|
129
132
|
function addBuildTarget(tree, options) {
|
|
130
|
-
(0,
|
|
133
|
+
(0, internal_1.addBuildTargetDefaults)(tree, '@nx/webpack:webpack', 'build', [
|
|
134
|
+
ts_solution_setup_1.TS_SOLUTION_SETUP_TSCONFIG_INPUT,
|
|
135
|
+
]);
|
|
131
136
|
const project = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
132
137
|
const buildOptions = {
|
|
133
138
|
target: options.target,
|
package/src/generators/convert-config-to-webpack-plugin/convert-config-to-webpack-plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert-config-to-webpack-plugin.d.ts","sourceRoot":"","sources":["../../../../../../packages/webpack/src/generators/convert-config-to-webpack-plugin/convert-config-to-webpack-plugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"convert-config-to-webpack-plugin.d.ts","sourceRoot":"","sources":["../../../../../../packages/webpack/src/generators/convert-config-to-webpack-plugin/convert-config-to-webpack-plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,IAAI,EAIL,MAAM,YAAY,CAAC;AAOpB,UAAU,MAAM;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAWD,wBAAsB,qCAAqC,CACzD,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,MAAM,iBAwGhB;AAED,eAAe,qCAAqC,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.convertConfigToWebpackPluginGenerator = convertConfigToWebpackPluginGenerator;
|
|
4
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
4
5
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const executor_options_utils_1 = require("@nx/devkit/src/generators/executor-options-utils");
|
|
6
6
|
const extract_webpack_options_1 = require("./lib/extract-webpack-options");
|
|
7
7
|
const normalize_path_options_1 = require("./lib/normalize-path-options");
|
|
8
8
|
const path_1 = require("path");
|
|
@@ -18,7 +18,7 @@ const preprocessText = (text) => {
|
|
|
18
18
|
async function convertConfigToWebpackPluginGenerator(tree, options) {
|
|
19
19
|
let migrated = 0;
|
|
20
20
|
const projects = (0, devkit_1.getProjects)(tree);
|
|
21
|
-
(0,
|
|
21
|
+
(0, internal_1.forEachExecutorOptions)(tree, '@nx/webpack:webpack', (currentTargetOptions, projectName, targetName, configurationName) => {
|
|
22
22
|
if (options.project && projectName !== options.project) {
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert-to-inferred.d.ts","sourceRoot":"","sources":["../../../../../../packages/webpack/src/generators/convert-to-inferred/convert-to-inferred.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"convert-to-inferred.d.ts","sourceRoot":"","sources":["../../../../../../packages/webpack/src/generators/convert-to-inferred/convert-to-inferred.ts"],"names":[],"mappings":"AAKA,OAAO,EAML,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AAUpB,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE/D,UAAU,MAAM;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,mDAyElE;AA6CD,wBAAgB,sBAAsB,IAAI,OAAO,YAAY,GAAG;IAC9D,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACtC,SAAS,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,KAAK,IAAI,CAAC;CAC5D,CAkCA"}
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.convertToInferred = convertToInferred;
|
|
4
4
|
exports.createCollectingLogger = createCollectingLogger;
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
5
6
|
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const aggregate_log_util_1 = require("@nx/devkit/src/generators/plugin-migrations/aggregate-log-util");
|
|
7
|
-
const executor_to_plugin_migrator_1 = require("@nx/devkit/src/generators/plugin-migrations/executor-to-plugin-migrator");
|
|
8
7
|
const tsquery_1 = require("@phenomnomnominal/tsquery");
|
|
9
8
|
const plugin_1 = require("../../plugins/plugin");
|
|
10
9
|
const versions_1 = require("../../utils/versions");
|
|
@@ -13,12 +12,12 @@ const devkit_exports_1 = require("nx/src/devkit-exports");
|
|
|
13
12
|
async function convertToInferred(tree, options) {
|
|
14
13
|
const projectGraph = await (0, devkit_1.createProjectGraphAsync)();
|
|
15
14
|
const migrationContext = {
|
|
16
|
-
logger: new
|
|
15
|
+
logger: new internal_1.AggregatedLog(),
|
|
17
16
|
projectGraph,
|
|
18
17
|
workspaceRoot: tree.root,
|
|
19
18
|
};
|
|
20
19
|
const logger = createCollectingLogger();
|
|
21
|
-
const migratedProjects = await (0,
|
|
20
|
+
const migratedProjects = await (0, internal_1.migrateProjectExecutorsToPlugin)(tree, projectGraph, '@nx/webpack/plugin', plugin_1.createNodesV2, {
|
|
22
21
|
buildTargetName: 'build',
|
|
23
22
|
previewTargetName: 'preview',
|
|
24
23
|
serveStaticTargetName: 'serve-static',
|
|
@@ -47,7 +46,7 @@ async function convertToInferred(tree, options) {
|
|
|
47
46
|
}
|
|
48
47
|
else {
|
|
49
48
|
logger.flushLogs();
|
|
50
|
-
throw new
|
|
49
|
+
throw new internal_1.NoTargetsToMigrateError();
|
|
51
50
|
}
|
|
52
51
|
}
|
|
53
52
|
else {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.buildPostTargetTransformerFactory = buildPostTargetTransformerFactory;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
6
6
|
const tsquery_1 = require("@phenomnomnominal/tsquery");
|
|
7
7
|
const ts = tslib_1.__importStar(require("typescript"));
|
|
8
8
|
const ast_1 = require("./ast");
|
|
@@ -16,7 +16,7 @@ function buildPostTargetTransformerFactory(migrationContext) {
|
|
|
16
16
|
const { pluginOptions, webpackConfigPath } = processOptions(target, context);
|
|
17
17
|
updateWebpackConfig(tree, webpackConfigPath, pluginOptions);
|
|
18
18
|
if (target.outputs) {
|
|
19
|
-
(0,
|
|
19
|
+
(0, internal_1.processTargetOutputs)(target, [], inferredTarget, {
|
|
20
20
|
projectName: projectDetails.projectName,
|
|
21
21
|
projectRoot: projectDetails.root,
|
|
22
22
|
});
|
|
@@ -51,29 +51,29 @@ function extractPluginOptions(options, context, configName) {
|
|
|
51
51
|
const pluginOptions = {};
|
|
52
52
|
for (const [key, value] of Object.entries(options)) {
|
|
53
53
|
if (pathOptions.has(key)) {
|
|
54
|
-
pluginOptions[key] = (0,
|
|
54
|
+
pluginOptions[key] = (0, internal_1.toProjectRelativePath)(value, context.projectRoot);
|
|
55
55
|
delete options[key];
|
|
56
56
|
}
|
|
57
57
|
else if (assetsOptions.has(key)) {
|
|
58
58
|
pluginOptions[key] = value.map((asset) => {
|
|
59
59
|
if (typeof asset === 'string') {
|
|
60
|
-
return (0,
|
|
60
|
+
return (0, internal_1.toProjectRelativePath)(asset, context.projectRoot);
|
|
61
61
|
}
|
|
62
|
-
asset.input = (0,
|
|
62
|
+
asset.input = (0, internal_1.toProjectRelativePath)(asset.input, context.projectRoot);
|
|
63
63
|
return asset;
|
|
64
64
|
});
|
|
65
65
|
delete options[key];
|
|
66
66
|
}
|
|
67
67
|
else if (key === 'fileReplacements') {
|
|
68
68
|
pluginOptions.fileReplacements = value.map((replacement) => ({
|
|
69
|
-
replace: (0,
|
|
70
|
-
with: (0,
|
|
69
|
+
replace: (0, internal_1.toProjectRelativePath)(replacement.replace, context.projectRoot),
|
|
70
|
+
with: (0, internal_1.toProjectRelativePath)(replacement.with, context.projectRoot),
|
|
71
71
|
}));
|
|
72
72
|
delete options.fileReplacements;
|
|
73
73
|
}
|
|
74
74
|
else if (key === 'additionalEntryPoints') {
|
|
75
75
|
pluginOptions.additionalEntryPoints = value.map((entryPoint) => {
|
|
76
|
-
entryPoint.entryPath = (0,
|
|
76
|
+
entryPoint.entryPath = (0, internal_1.toProjectRelativePath)(entryPoint.entryPath, context.projectRoot);
|
|
77
77
|
return entryPoint;
|
|
78
78
|
});
|
|
79
79
|
delete options.additionalEntryPoints;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serve-post-target-transformer.d.ts","sourceRoot":"","sources":["../../../../../../../packages/webpack/src/generators/convert-to-inferred/utils/serve-post-target-transformer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"serve-post-target-transformer.d.ts","sourceRoot":"","sources":["../../../../../../../packages/webpack/src/generators/convert-to-inferred/utils/serve-post-target-transformer.ts"],"names":[],"mappings":"AAIA,OAAO,EAML,KAAK,mBAAmB,EACxB,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AAQpB,OAAO,KAAK,EAAE,gBAAgB,EAAsB,MAAM,SAAS,CAAC;AAEpE,wBAAgB,iCAAiC,CAC/C,gBAAgB,EAAE,gBAAgB,IAGhC,QAAQ,mBAAmB,EAC3B,MAAM,IAAI,EACV,gBAAgB;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EACrD,gBAAgB,mBAAmB,KAClC,OAAO,CAAC,mBAAmB,CAAC,CAwBhC"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.servePostTargetTransformerFactory = servePostTargetTransformerFactory;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
5
6
|
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const plugin_migration_utils_1 = require("@nx/devkit/src/generators/plugin-migrations/plugin-migration-utils");
|
|
7
7
|
const tsquery_1 = require("@phenomnomnominal/tsquery");
|
|
8
8
|
const path_1 = require("path");
|
|
9
9
|
const ts = tslib_1.__importStar(require("typescript"));
|
|
@@ -19,7 +19,7 @@ function servePostTargetTransformerFactory(migrationContext) {
|
|
|
19
19
|
const { devServerOptions, webpackConfigPath } = await processOptions(tree, target, context);
|
|
20
20
|
updateWebpackConfig(tree, webpackConfigPath, devServerOptions, context);
|
|
21
21
|
if (target.outputs) {
|
|
22
|
-
(0,
|
|
22
|
+
(0, internal_1.processTargetOutputs)(target, [], inferredTarget, {
|
|
23
23
|
projectName: projectDetails.projectName,
|
|
24
24
|
projectRoot: projectDetails.root,
|
|
25
25
|
});
|
|
@@ -87,8 +87,8 @@ function extractDevServerOptions(options, context) {
|
|
|
87
87
|
devServerOptions.server = { type: 'https' };
|
|
88
88
|
if (options.sslCert && options.sslKey) {
|
|
89
89
|
devServerOptions.server.options = {};
|
|
90
|
-
devServerOptions.server.options.cert = (0,
|
|
91
|
-
devServerOptions.server.options.key = (0,
|
|
90
|
+
devServerOptions.server.options.cert = (0, internal_1.toProjectRelativePath)(options.sslCert, context.projectRoot);
|
|
91
|
+
devServerOptions.server.options.key = (0, internal_1.toProjectRelativePath)(options.sslKey, context.projectRoot);
|
|
92
92
|
}
|
|
93
93
|
else if (options.sslCert) {
|
|
94
94
|
context.logger.addLog({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ProjectGraph } from '@nx/devkit';
|
|
2
|
-
import type { AggregatedLog } from '@nx/devkit/
|
|
2
|
+
import type { AggregatedLog } from '@nx/devkit/internal';
|
|
3
3
|
export type MigrationContext = {
|
|
4
4
|
logger: AggregatedLog;
|
|
5
5
|
projectGraph: ProjectGraph;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../packages/webpack/src/generators/convert-to-inferred/utils/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../packages/webpack/src/generators/convert-to-inferred/utils/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,aAAa,CAAC;IACtB,YAAY,EAAE,YAAY,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,gBAAgB,GAAG;IAClD,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../../packages/webpack/src/generators/init/init.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../../packages/webpack/src/generators/init/init.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,iBAAiB,EAEjB,IAAI,EACL,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,8BAE9D;AAED,wBAAsB,4BAA4B,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,8BAkF5E;AAED,eAAe,oBAAoB,CAAC"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.webpackInitGenerator = webpackInitGenerator;
|
|
4
4
|
exports.webpackInitGeneratorInternal = webpackInitGeneratorInternal;
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
5
6
|
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const add_plugin_1 = require("@nx/devkit/src/utils/add-plugin");
|
|
7
7
|
const plugin_1 = require("../../plugins/plugin");
|
|
8
8
|
const versions_1 = require("../../utils/versions");
|
|
9
9
|
function webpackInitGenerator(tree, schema) {
|
|
@@ -15,7 +15,7 @@ async function webpackInitGeneratorInternal(tree, schema) {
|
|
|
15
15
|
nxJson.useInferencePlugins !== false;
|
|
16
16
|
schema.addPlugin ??= addPluginDefault;
|
|
17
17
|
if (schema.addPlugin) {
|
|
18
|
-
await (0,
|
|
18
|
+
await (0, internal_1.addPlugin)(tree, await (0, devkit_1.createProjectGraphAsync)(), '@nx/webpack/plugin', plugin_1.createNodesV2, {
|
|
19
19
|
buildTargetName: [
|
|
20
20
|
'build',
|
|
21
21
|
'webpack:build',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove-isolated-config.d.ts","sourceRoot":"","sources":["../../../../../../packages/webpack/src/migrations/update-21-0-0/remove-isolated-config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"remove-isolated-config.d.ts","sourceRoot":"","sources":["../../../../../../packages/webpack/src/migrations/update-21-0-0/remove-isolated-config.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,IAAI,EAEL,MAAM,YAAY,CAAC;AAGpB,yBAA+B,IAAI,EAAE,IAAI,iBAkDxC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = default_1;
|
|
4
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
4
5
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const executor_options_utils_1 = require("@nx/devkit/src/generators/executor-options-utils");
|
|
6
6
|
async function default_1(tree) {
|
|
7
|
-
(0,
|
|
7
|
+
(0, internal_1.forEachExecutorOptions)(tree, '@nx/webpack:webpack', (options, projectName, targetName, configurationName) => {
|
|
8
8
|
// Only handle webpack config for default configuration
|
|
9
9
|
if (configurationName)
|
|
10
10
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply-web-config.d.ts","sourceRoot":"","sources":["../../../../../../../packages/webpack/src/plugins/nx-webpack-plugin/lib/apply-web-config.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,aAAa,EAIb,wBAAwB,EAEzB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,mCAAmC,EAAE,MAAM,kCAAkC,CAAC;AAavF,wBAAgB,cAAc,CAC5B,OAAO,EAAE,mCAAmC,EAC5C,MAAM,GAAE,OAAO,CAAC,wBAAwB,GAAG,aAAa,CAAM,EAC9D,EACE,kBAAkB,GACnB,GAAE;IAID,kBAAkB,CAAC,EAAE,OAAO,CAAC;CACzB,GACL,IAAI,
|
|
1
|
+
{"version":3,"file":"apply-web-config.d.ts","sourceRoot":"","sources":["../../../../../../../packages/webpack/src/plugins/nx-webpack-plugin/lib/apply-web-config.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,aAAa,EAIb,wBAAwB,EAEzB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,mCAAmC,EAAE,MAAM,kCAAkC,CAAC;AAavF,wBAAgB,cAAc,CAC5B,OAAO,EAAE,mCAAmC,EAC5C,MAAM,GAAE,OAAO,CAAC,wBAAwB,GAAG,aAAa,CAAM,EAC9D,EACE,kBAAkB,GACnB,GAAE;IAID,kBAAkB,CAAC,EAAE,OAAO,CAAC;CACzB,GACL,IAAI,CA2VN"}
|
|
@@ -118,7 +118,7 @@ function applyWebConfig(options, config = {}, { useNormalizedEntry, } = {}) {
|
|
|
118
118
|
use: [
|
|
119
119
|
...(0, stylesheet_loaders_1.getCommonLoadersForCssModules)(options, includePaths),
|
|
120
120
|
{
|
|
121
|
-
loader:
|
|
121
|
+
loader: path.join(__dirname, '../../../utils/webpack/deprecated-less-loader.js'),
|
|
122
122
|
options: {
|
|
123
123
|
lessOptions: {
|
|
124
124
|
paths: includePaths,
|
|
@@ -163,7 +163,7 @@ function applyWebConfig(options, config = {}, { useNormalizedEntry, } = {}) {
|
|
|
163
163
|
use: [
|
|
164
164
|
...(0, stylesheet_loaders_1.getCommonLoadersForGlobalCss)(options, includePaths),
|
|
165
165
|
{
|
|
166
|
-
loader:
|
|
166
|
+
loader: path.join(__dirname, '../../../utils/webpack/deprecated-less-loader.js'),
|
|
167
167
|
options: {
|
|
168
168
|
sourceMap: !!options.sourceMap,
|
|
169
169
|
lessOptions: {
|
|
@@ -210,7 +210,7 @@ function applyWebConfig(options, config = {}, { useNormalizedEntry, } = {}) {
|
|
|
210
210
|
use: [
|
|
211
211
|
...(0, stylesheet_loaders_1.getCommonLoadersForGlobalStyle)(options, includePaths),
|
|
212
212
|
{
|
|
213
|
-
loader:
|
|
213
|
+
loader: path.join(__dirname, '../../../utils/webpack/deprecated-less-loader.js'),
|
|
214
214
|
options: {
|
|
215
215
|
sourceMap: !!options.sourceMap,
|
|
216
216
|
lessOptions: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/webpack/src/plugins/plugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/webpack/src/plugins/plugin.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,kBAAkB,EAIlB,aAAa,EAOd,MAAM,YAAY,CAAC;AAcpB,MAAM,WAAW,oBAAoB;IACnC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAID;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,kBAEhC,CAAC;AAIF,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC,oBAAoB,CAkC3D,CAAC;AAEF,eAAO,MAAM,aAAa,qCAAc,CAAC"}
|
package/src/plugins/plugin.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createNodesV2 = exports.createNodes = exports.createDependencies = void 0;
|
|
4
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
4
5
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const calculate_hash_for_create_nodes_1 = require("@nx/devkit/src/utils/calculate-hash-for-create-nodes");
|
|
6
|
-
const get_named_inputs_1 = require("@nx/devkit/src/utils/get-named-inputs");
|
|
7
6
|
const js_1 = require("@nx/js");
|
|
8
7
|
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
9
8
|
const fs_1 = require("fs");
|
|
@@ -13,12 +12,6 @@ const path_1 = require("path");
|
|
|
13
12
|
const read_webpack_options_1 = require("../utils/webpack/read-webpack-options");
|
|
14
13
|
const resolve_user_defined_webpack_config_1 = require("../utils/webpack/resolve-user-defined-webpack-config");
|
|
15
14
|
const util_1 = require("@nx/js/src/plugins/typescript/util");
|
|
16
|
-
function readTargetsCache(cachePath) {
|
|
17
|
-
return (0, fs_1.existsSync)(cachePath) ? (0, devkit_1.readJsonFile)(cachePath) : {};
|
|
18
|
-
}
|
|
19
|
-
function writeTargetsToCache(cachePath, results) {
|
|
20
|
-
(0, devkit_1.writeJsonFile)(cachePath, results);
|
|
21
|
-
}
|
|
22
15
|
/**
|
|
23
16
|
* @deprecated The 'createDependencies' function is now a no-op. This functionality is included in 'createNodesV2'.
|
|
24
17
|
*/
|
|
@@ -32,20 +25,22 @@ exports.createNodes = [
|
|
|
32
25
|
async (configFilePaths, options, context) => {
|
|
33
26
|
const optionsHash = (0, file_hasher_1.hashObject)(options);
|
|
34
27
|
const cachePath = (0, path_1.join)(cache_directory_1.workspaceDataDirectory, `webpack-${optionsHash}.hash`);
|
|
35
|
-
const targetsCache =
|
|
28
|
+
const targetsCache = new internal_1.PluginCache(cachePath);
|
|
36
29
|
const normalizedOptions = normalizeOptions(options);
|
|
37
30
|
const isTsSolutionSetup = (0, ts_solution_setup_1.isUsingTsSolutionSetup)();
|
|
38
|
-
const
|
|
31
|
+
const packageManager = (0, devkit_1.detectPackageManager)(context.workspaceRoot);
|
|
32
|
+
const pmc = (0, devkit_1.getPackageManagerCommand)(packageManager);
|
|
33
|
+
const lockFileName = (0, js_1.getLockFileName)(packageManager);
|
|
39
34
|
try {
|
|
40
|
-
return await (0, devkit_1.createNodesFromFiles)((configFile, options, context) => createNodesInternal(configFile, options, context, targetsCache, isTsSolutionSetup, pmc), configFilePaths, normalizedOptions, context);
|
|
35
|
+
return await (0, devkit_1.createNodesFromFiles)((configFile, options, context) => createNodesInternal(configFile, options, context, targetsCache, isTsSolutionSetup, pmc, lockFileName), configFilePaths, normalizedOptions, context);
|
|
41
36
|
}
|
|
42
37
|
finally {
|
|
43
|
-
|
|
38
|
+
targetsCache.writeToDisk();
|
|
44
39
|
}
|
|
45
40
|
},
|
|
46
41
|
];
|
|
47
42
|
exports.createNodesV2 = exports.createNodes;
|
|
48
|
-
async function createNodesInternal(configFilePath, options, context, targetsCache, isTsSolutionSetup, pmc) {
|
|
43
|
+
async function createNodesInternal(configFilePath, options, context, targetsCache, isTsSolutionSetup, pmc, lockFileName) {
|
|
49
44
|
const projectRoot = (0, path_1.dirname)(configFilePath);
|
|
50
45
|
// Do not create a project if package.json and project.json isn't there.
|
|
51
46
|
const siblingFiles = (0, fs_1.readdirSync)((0, path_1.join)(context.workspaceRoot, projectRoot));
|
|
@@ -53,9 +48,11 @@ async function createNodesInternal(configFilePath, options, context, targetsCach
|
|
|
53
48
|
!siblingFiles.includes('project.json')) {
|
|
54
49
|
return {};
|
|
55
50
|
}
|
|
56
|
-
const hash = await (0,
|
|
57
|
-
targetsCache
|
|
58
|
-
|
|
51
|
+
const hash = await (0, internal_1.calculateHashForCreateNodes)(projectRoot, options, context, [lockFileName]);
|
|
52
|
+
if (!targetsCache.has(hash)) {
|
|
53
|
+
targetsCache.set(hash, await createWebpackTargets(configFilePath, projectRoot, options, context, isTsSolutionSetup, pmc));
|
|
54
|
+
}
|
|
55
|
+
const { targets, metadata } = targetsCache.get(hash);
|
|
59
56
|
return {
|
|
60
57
|
projects: {
|
|
61
58
|
[projectRoot]: {
|
|
@@ -67,7 +64,7 @@ async function createNodesInternal(configFilePath, options, context, targetsCach
|
|
|
67
64
|
};
|
|
68
65
|
}
|
|
69
66
|
async function createWebpackTargets(configFilePath, projectRoot, options, context, isTsSolutionSetup, pmc) {
|
|
70
|
-
const namedInputs = (0,
|
|
67
|
+
const namedInputs = (0, internal_1.getNamedInputs)(projectRoot, context);
|
|
71
68
|
const webpackConfig = (0, resolve_user_defined_webpack_config_1.resolveUserDefinedWebpackConfig)((0, path_1.join)(context.workspaceRoot, configFilePath), (0, js_1.getRootTsConfigPath)(), true);
|
|
72
69
|
const webpackOptions = await (0, read_webpack_options_1.readWebpackOptions)(webpackConfig);
|
|
73
70
|
const outputs = [];
|
|
@@ -89,6 +86,7 @@ async function createWebpackTargets(configFilePath, projectRoot, options, contex
|
|
|
89
86
|
{
|
|
90
87
|
externalDependencies: ['webpack-cli'],
|
|
91
88
|
},
|
|
89
|
+
ts_solution_setup_1.TS_SOLUTION_SETUP_TSCONFIG_INPUT,
|
|
92
90
|
]
|
|
93
91
|
: [
|
|
94
92
|
'default',
|
|
@@ -96,6 +94,7 @@ async function createWebpackTargets(configFilePath, projectRoot, options, contex
|
|
|
96
94
|
{
|
|
97
95
|
externalDependencies: ['webpack-cli'],
|
|
98
96
|
},
|
|
97
|
+
ts_solution_setup_1.TS_SOLUTION_SETUP_TSCONFIG_INPUT,
|
|
99
98
|
],
|
|
100
99
|
outputs,
|
|
101
100
|
metadata: {
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const WEBPACK_EXECUTOR_DEPRECATION_MESSAGE = "The `@nx/webpack:webpack` executor is deprecated and will be removed in Nx v24. Run `nx g @nx/webpack:convert-to-inferred` to migrate to the `@nx/webpack/plugin` inferred targets. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.";
|
|
2
|
+
export declare const WEBPACK_DEV_SERVER_EXECUTOR_DEPRECATION_MESSAGE = "The `@nx/webpack:dev-server` executor is deprecated and will be removed in Nx v24. Run `nx g @nx/webpack:convert-to-inferred` to migrate to the `@nx/webpack/plugin` inferred targets. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.";
|
|
3
|
+
export declare function warnWebpackExecutorDeprecation(): void;
|
|
4
|
+
export declare function warnWebpackDevServerExecutorDeprecation(): void;
|
|
5
|
+
export declare function warnWebpackExecutorGenerating(): void;
|
|
6
|
+
//# sourceMappingURL=deprecation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deprecation.d.ts","sourceRoot":"","sources":["../../../../../packages/webpack/src/utils/deprecation.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,oCAAoC,uQACqN,CAAC;AAEvQ,eAAO,MAAM,+CAA+C,0QAC6M,CAAC;AAE1Q,wBAAgB,8BAA8B,IAAI,IAAI,CAErD;AAED,wBAAgB,uCAAuC,IAAI,IAAI,CAE9D;AAMD,wBAAgB,6BAA6B,IAAI,IAAI,CAIpD"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WEBPACK_DEV_SERVER_EXECUTOR_DEPRECATION_MESSAGE = exports.WEBPACK_EXECUTOR_DEPRECATION_MESSAGE = void 0;
|
|
4
|
+
exports.warnWebpackExecutorDeprecation = warnWebpackExecutorDeprecation;
|
|
5
|
+
exports.warnWebpackDevServerExecutorDeprecation = warnWebpackDevServerExecutorDeprecation;
|
|
6
|
+
exports.warnWebpackExecutorGenerating = warnWebpackExecutorGenerating;
|
|
7
|
+
const devkit_1 = require("@nx/devkit");
|
|
8
|
+
// TODO(v24): Remove the @nx/webpack:webpack and @nx/webpack:dev-server
|
|
9
|
+
// executors. The inferred plugin (@nx/webpack/plugin) and the
|
|
10
|
+
// convert-to-inferred generator stay supported.
|
|
11
|
+
exports.WEBPACK_EXECUTOR_DEPRECATION_MESSAGE = 'The `@nx/webpack:webpack` executor is deprecated and will be removed in Nx v24. Run `nx g @nx/webpack:convert-to-inferred` to migrate to the `@nx/webpack/plugin` inferred targets. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.';
|
|
12
|
+
exports.WEBPACK_DEV_SERVER_EXECUTOR_DEPRECATION_MESSAGE = 'The `@nx/webpack:dev-server` executor is deprecated and will be removed in Nx v24. Run `nx g @nx/webpack:convert-to-inferred` to migrate to the `@nx/webpack/plugin` inferred targets. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.';
|
|
13
|
+
function warnWebpackExecutorDeprecation() {
|
|
14
|
+
devkit_1.logger.warn(exports.WEBPACK_EXECUTOR_DEPRECATION_MESSAGE);
|
|
15
|
+
}
|
|
16
|
+
function warnWebpackDevServerExecutorDeprecation() {
|
|
17
|
+
devkit_1.logger.warn(exports.WEBPACK_DEV_SERVER_EXECUTOR_DEPRECATION_MESSAGE);
|
|
18
|
+
}
|
|
19
|
+
// Fired when the @nx/webpack:configuration generator is about to generate
|
|
20
|
+
// targets that use the deprecated executors — i.e. when @nx/webpack/plugin
|
|
21
|
+
// isn't registered in nx.json. Surfaces the deprecation at generation time
|
|
22
|
+
// rather than only when the user later runs the generated targets.
|
|
23
|
+
function warnWebpackExecutorGenerating() {
|
|
24
|
+
devkit_1.logger.warn('Generating targets that use the deprecated `@nx/webpack:webpack` and `@nx/webpack:dev-server` executors. These executors will be removed in Nx v24. Run `nx g @nx/webpack:convert-to-inferred` next to migrate these targets to the `@nx/webpack/plugin` inferred plugin and prevent future generators from emitting executor targets. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.');
|
|
25
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type Tree } from '@nx/devkit';
|
|
2
|
-
export declare function getWebpackE2EWebServerInfo(tree: Tree, projectName: string, configFilePath: string, isPluginBeingAdded: boolean, e2ePortOverride?: number): Promise<import("@nx/devkit/
|
|
2
|
+
export declare function getWebpackE2EWebServerInfo(tree: Tree, projectName: string, configFilePath: string, isPluginBeingAdded: boolean, e2ePortOverride?: number): Promise<import("@nx/devkit/internal").E2EWebServerDetails>;
|
|
3
3
|
//# sourceMappingURL=e2e-web-server-info-utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"e2e-web-server-info-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/webpack/src/utils/e2e-web-server-info-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAc,MAAM,YAAY,CAAC;AAGnD,wBAAsB,0BAA0B,CAC9C,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,EACtB,kBAAkB,EAAE,OAAO,EAC3B,eAAe,CAAC,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"e2e-web-server-info-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/webpack/src/utils/e2e-web-server-info-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAc,MAAM,YAAY,CAAC;AAGnD,wBAAsB,0BAA0B,CAC9C,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,EACtB,kBAAkB,EAAE,OAAO,EAC3B,eAAe,CAAC,EAAE,MAAM,8DA8BzB"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getWebpackE2EWebServerInfo = getWebpackE2EWebServerInfo;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
6
6
|
async function getWebpackE2EWebServerInfo(tree, projectName, configFilePath, isPluginBeingAdded, e2ePortOverride) {
|
|
7
7
|
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
8
8
|
let e2ePort = e2ePortOverride ?? 4200;
|
|
@@ -10,7 +10,7 @@ async function getWebpackE2EWebServerInfo(tree, projectName, configFilePath, isP
|
|
|
10
10
|
nxJson.targetDefaults?.['serve'].options?.port) {
|
|
11
11
|
e2ePort = nxJson.targetDefaults?.['serve'].options?.port;
|
|
12
12
|
}
|
|
13
|
-
return (0,
|
|
13
|
+
return (0, internal_1.getE2EWebServerInfo)(tree, projectName, {
|
|
14
14
|
plugin: '@nx/webpack/plugin',
|
|
15
15
|
serveTargetName: 'serveTargetName',
|
|
16
16
|
serveStaticTargetName: 'serveStaticTargetName',
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const lessLoader = require('less-loader');
|
|
2
|
+
|
|
3
|
+
module.exports = function (...args) {
|
|
4
|
+
if (!process.env.__NX_LESS_DEPRECATION_WARNED) {
|
|
5
|
+
process.env.__NX_LESS_DEPRECATION_WARNED = '1';
|
|
6
|
+
console.warn(
|
|
7
|
+
'\n⚠️ Less support in Nx is deprecated and will be removed in a future version.\n' +
|
|
8
|
+
' Please migrate to CSS or SCSS.\n' +
|
|
9
|
+
' Existing .less imports continue to compile, but Nx generators no longer\n' +
|
|
10
|
+
' accept --style=less. To add new Less files, install less-loader manually\n' +
|
|
11
|
+
' and generate with --style=css, then rename the file to .less.\n'
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
return lessLoader.apply(this, args);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
if (lessLoader.raw) {
|
|
18
|
+
module.exports.raw = lessLoader.raw;
|
|
19
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.resolveUserDefinedWebpackConfig = resolveUserDefinedWebpackConfig;
|
|
4
|
-
const internal_1 = require("@nx/
|
|
5
|
-
const
|
|
4
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
5
|
+
const internal_2 = require("@nx/js/src/internal");
|
|
6
6
|
function resolveUserDefinedWebpackConfig(path, tsConfig,
|
|
7
7
|
/** Skip require cache and return latest content */
|
|
8
8
|
reload = false) {
|
|
@@ -10,7 +10,7 @@ reload = false) {
|
|
|
10
10
|
// Clear cache if the path is in the cache
|
|
11
11
|
if (require.cache[path]) {
|
|
12
12
|
// Clear all entries because config may import other modules
|
|
13
|
-
(0,
|
|
13
|
+
(0, internal_1.clearRequireCache)();
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
// Don't transpile non-TS files. This prevents workspaces libs from being registered via tsconfig-paths.
|
|
@@ -18,7 +18,7 @@ reload = false) {
|
|
|
18
18
|
if (!/\.(ts|mts|cts)$/.test(path)) {
|
|
19
19
|
return require(path);
|
|
20
20
|
}
|
|
21
|
-
const cleanupTranspiler = (0,
|
|
21
|
+
const cleanupTranspiler = (0, internal_2.registerTsProject)(tsConfig);
|
|
22
22
|
const maybeCustomWebpackConfig = require(path);
|
|
23
23
|
cleanupTranspiler();
|
|
24
24
|
// If the user provides a configuration in TS file
|