@nx/webpack 23.0.0-beta.23 → 23.0.0-beta.25
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/{app-plugin.d.ts → dist/app-plugin.d.ts} +0 -1
- package/{index.d.ts → dist/index.d.ts} +0 -1
- package/dist/internal.d.ts +8 -0
- package/dist/internal.js +26 -0
- package/{plugin.d.ts → dist/plugin.d.ts} +0 -1
- package/{src → dist/src}/executors/dev-server/dev-server.impl.d.ts +0 -1
- package/{src → dist/src}/executors/dev-server/dev-server.impl.js +4 -4
- package/{src → dist/src}/executors/dev-server/lib/get-dev-server-config.d.ts +0 -1
- package/{src → dist/src}/executors/dev-server/lib/serve-path.d.ts +0 -1
- package/{src → dist/src}/executors/ssr-dev-server/lib/wait-until-server-is-listening.d.ts +0 -1
- package/{src → dist/src}/executors/ssr-dev-server/ssr-dev-server.impl.d.ts +0 -1
- package/{src → dist/src}/executors/webpack/lib/normalize-options.d.ts +0 -1
- package/{src → dist/src}/executors/webpack/lib/run-webpack.d.ts +1 -2
- package/{src → dist/src}/executors/webpack/lib/run-webpack.js +3 -3
- package/{src → dist/src}/executors/webpack/webpack.impl.d.ts +0 -1
- package/{src → dist/src}/generators/configuration/configuration.d.ts +0 -1
- package/{src → dist/src}/generators/configuration/configuration.js +2 -0
- package/{src → dist/src}/generators/convert-config-to-webpack-plugin/convert-config-to-webpack-plugin.d.ts +0 -1
- package/{src → dist/src}/generators/convert-config-to-webpack-plugin/convert-config-to-webpack-plugin.js +2 -0
- package/{src → dist/src}/generators/convert-config-to-webpack-plugin/lib/extract-webpack-options.d.ts +0 -1
- package/{src → dist/src}/generators/convert-config-to-webpack-plugin/lib/normalize-path-options.d.ts +0 -1
- package/{src → dist/src}/generators/convert-config-to-webpack-plugin/lib/utils.d.ts +0 -1
- package/{src → dist/src}/generators/convert-config-to-webpack-plugin/lib/validate-project.d.ts +0 -1
- package/{src → dist/src}/generators/convert-to-inferred/convert-to-inferred.d.ts +0 -1
- package/{src → dist/src}/generators/convert-to-inferred/convert-to-inferred.js +1 -0
- package/{src → dist/src}/generators/convert-to-inferred/utils/ast.d.ts +0 -1
- package/{src → dist/src}/generators/convert-to-inferred/utils/build-post-target-transformer.d.ts +0 -1
- package/{src → dist/src}/generators/convert-to-inferred/utils/index.d.ts +0 -1
- package/{src → dist/src}/generators/convert-to-inferred/utils/serve-post-target-transformer.d.ts +0 -1
- package/{src → dist/src}/generators/convert-to-inferred/utils/types.d.ts +0 -1
- package/{src → dist/src}/generators/init/init.d.ts +0 -1
- package/{src → dist/src}/generators/init/init.js +8 -1
- package/{src → dist/src}/generators/init/schema.json +1 -1
- package/{src → dist/src}/migrations/update-21-0-0/remove-isolated-config.d.ts +0 -1
- package/{src → dist/src}/migrations/update-22-0-0/remove-deprecated-options.d.ts +0 -1
- package/dist/src/migrations/update-23-0-0/migrate-create-nodes-v2-to-create-nodes.d.ts +9 -0
- package/dist/src/migrations/update-23-0-0/migrate-create-nodes-v2-to-create-nodes.js +134 -0
- package/dist/src/migrations/update-23-0-0/migrate-create-nodes-v2-to-create-nodes.md +25 -0
- package/{src → dist/src}/migrations/update-23-0-0/remove-nx-tsconfig-paths-webpack-plugin-import.d.ts +0 -1
- package/dist/src/migrations/update-23-0-0/rewrite-internal-subpath-imports.d.ts +3 -0
- package/dist/src/migrations/update-23-0-0/rewrite-internal-subpath-imports.js +225 -0
- package/{src → dist/src}/plugins/generate-package-json-plugin.d.ts +0 -1
- package/{src → dist/src}/plugins/nx-typescript-webpack-plugin/nx-tsconfig-paths-webpack-plugin.d.ts +0 -1
- package/{src → dist/src}/plugins/nx-webpack-plugin/lib/apply-base-config.d.ts +0 -1
- package/{src → dist/src}/plugins/nx-webpack-plugin/lib/apply-web-config.d.ts +0 -1
- package/{src → dist/src}/plugins/nx-webpack-plugin/lib/compiler-loaders.d.ts +0 -1
- package/{src → dist/src}/plugins/nx-webpack-plugin/lib/get-terser-ecma-version.d.ts +0 -1
- package/{src → dist/src}/plugins/nx-webpack-plugin/lib/instantiate-script-plugins.d.ts +0 -1
- package/{src → dist/src}/plugins/nx-webpack-plugin/lib/normalize-options.d.ts +0 -1
- package/{src → dist/src}/plugins/nx-webpack-plugin/lib/stylesheet-loaders.d.ts +0 -1
- package/{src → dist/src}/plugins/nx-webpack-plugin/lib/utils.d.ts +0 -1
- package/{src → dist/src}/plugins/nx-webpack-plugin/nx-app-webpack-plugin-options.d.ts +0 -1
- package/{src → dist/src}/plugins/nx-webpack-plugin/nx-app-webpack-plugin.d.ts +0 -1
- package/{src → dist/src}/plugins/plugin.d.ts +0 -1
- package/{src → dist/src}/plugins/plugin.js +3 -3
- package/{src → dist/src}/plugins/stats-json-plugin.d.ts +0 -1
- package/{src → dist/src}/plugins/use-legacy-nx-plugin/use-legacy-nx-plugin.d.ts +0 -1
- package/{src → dist/src}/plugins/webpack-nx-build-coordination-plugin.d.ts +0 -1
- package/{src → dist/src}/plugins/write-index-html-plugin.d.ts +0 -1
- package/{src → dist/src}/utils/config.d.ts +12 -1
- package/{src → dist/src}/utils/config.js +15 -0
- package/{src → dist/src}/utils/create-copy-plugin.d.ts +0 -1
- package/{src → dist/src}/utils/deprecation.d.ts +3 -1
- package/{src → dist/src}/utils/deprecation.js +31 -1
- package/{src → dist/src}/utils/e2e-web-server-info-utils.d.ts +0 -1
- package/{src → dist/src}/utils/ensure-dependencies.d.ts +0 -1
- package/{src → dist/src}/utils/ensure-dependencies.js +1 -1
- package/{src → dist/src}/utils/fs.d.ts +0 -1
- package/{src → dist/src}/utils/get-client-environment.d.ts +0 -1
- package/{src → dist/src}/utils/get-css-module-local-ident.d.ts +0 -1
- package/{src → dist/src}/utils/has-plugin.d.ts +0 -1
- package/{src → dist/src}/utils/hash-format.d.ts +0 -1
- package/{src → dist/src}/utils/models.d.ts +0 -1
- package/{src → dist/src}/utils/run-webpack.d.ts +0 -1
- package/dist/src/utils/versions.d.ts +12 -0
- package/dist/src/utils/versions.js +24 -0
- package/dist/src/utils/web-babel-loader.d.ts +1 -0
- package/{src → dist/src}/utils/web-babel-loader.js +2 -0
- package/{src → dist/src}/utils/webpack/interpolate-env-variables-to-index.d.ts +0 -1
- package/{src → dist/src}/utils/webpack/normalize-entry.d.ts +0 -1
- package/{src → dist/src}/utils/webpack/package-chunk-sort.d.ts +0 -1
- package/{src → dist/src}/utils/webpack/plugins/postcss-cli-resources.d.ts +0 -1
- package/{src → dist/src}/utils/webpack/plugins/scripts-webpack-plugin.d.ts +0 -1
- package/{src → dist/src}/utils/webpack/read-webpack-options.d.ts +0 -1
- package/{src → dist/src}/utils/webpack/resolve-user-defined-webpack-config.d.ts +0 -1
- package/{src → dist/src}/utils/with-nx.d.ts +4 -1
- package/{src → dist/src}/utils/with-nx.js +6 -0
- package/{src → dist/src}/utils/with-web.d.ts +4 -1
- package/{src → dist/src}/utils/with-web.js +6 -0
- package/{tsconfig-paths-plugin.d.ts → dist/tsconfig-paths-plugin.d.ts} +0 -1
- package/executors.json +6 -6
- package/generators.json +8 -8
- package/migrations.json +29 -23
- package/package.json +79 -10
- package/app-plugin.d.ts.map +0 -1
- package/index.d.ts.map +0 -1
- package/plugin.d.ts.map +0 -1
- package/src/executors/dev-server/dev-server.impl.d.ts.map +0 -1
- package/src/executors/dev-server/lib/get-dev-server-config.d.ts.map +0 -1
- package/src/executors/dev-server/lib/serve-path.d.ts.map +0 -1
- package/src/executors/ssr-dev-server/lib/wait-until-server-is-listening.d.ts.map +0 -1
- package/src/executors/ssr-dev-server/ssr-dev-server.impl.d.ts.map +0 -1
- package/src/executors/webpack/lib/normalize-options.d.ts.map +0 -1
- package/src/executors/webpack/lib/run-webpack.d.ts.map +0 -1
- package/src/executors/webpack/webpack.impl.d.ts.map +0 -1
- package/src/generators/configuration/configuration.d.ts.map +0 -1
- package/src/generators/convert-config-to-webpack-plugin/convert-config-to-webpack-plugin.d.ts.map +0 -1
- package/src/generators/convert-config-to-webpack-plugin/lib/extract-webpack-options.d.ts.map +0 -1
- package/src/generators/convert-config-to-webpack-plugin/lib/normalize-path-options.d.ts.map +0 -1
- package/src/generators/convert-config-to-webpack-plugin/lib/utils.d.ts.map +0 -1
- package/src/generators/convert-config-to-webpack-plugin/lib/validate-project.d.ts.map +0 -1
- package/src/generators/convert-to-inferred/convert-to-inferred.d.ts.map +0 -1
- package/src/generators/convert-to-inferred/utils/ast.d.ts.map +0 -1
- package/src/generators/convert-to-inferred/utils/build-post-target-transformer.d.ts.map +0 -1
- package/src/generators/convert-to-inferred/utils/index.d.ts.map +0 -1
- package/src/generators/convert-to-inferred/utils/serve-post-target-transformer.d.ts.map +0 -1
- package/src/generators/convert-to-inferred/utils/types.d.ts.map +0 -1
- package/src/generators/init/init.d.ts.map +0 -1
- package/src/migrations/update-21-0-0/remove-isolated-config.d.ts.map +0 -1
- package/src/migrations/update-22-0-0/remove-deprecated-options.d.ts.map +0 -1
- package/src/migrations/update-23-0-0/remove-nx-tsconfig-paths-webpack-plugin-import.d.ts.map +0 -1
- package/src/plugins/generate-package-json-plugin.d.ts.map +0 -1
- package/src/plugins/nx-typescript-webpack-plugin/nx-tsconfig-paths-webpack-plugin.d.ts.map +0 -1
- package/src/plugins/nx-webpack-plugin/lib/apply-base-config.d.ts.map +0 -1
- package/src/plugins/nx-webpack-plugin/lib/apply-web-config.d.ts.map +0 -1
- package/src/plugins/nx-webpack-plugin/lib/compiler-loaders.d.ts.map +0 -1
- package/src/plugins/nx-webpack-plugin/lib/get-terser-ecma-version.d.ts.map +0 -1
- package/src/plugins/nx-webpack-plugin/lib/instantiate-script-plugins.d.ts.map +0 -1
- package/src/plugins/nx-webpack-plugin/lib/normalize-options.d.ts.map +0 -1
- package/src/plugins/nx-webpack-plugin/lib/stylesheet-loaders.d.ts.map +0 -1
- package/src/plugins/nx-webpack-plugin/lib/utils.d.ts.map +0 -1
- package/src/plugins/nx-webpack-plugin/nx-app-webpack-plugin-options.d.ts.map +0 -1
- package/src/plugins/nx-webpack-plugin/nx-app-webpack-plugin.d.ts.map +0 -1
- package/src/plugins/plugin.d.ts.map +0 -1
- package/src/plugins/stats-json-plugin.d.ts.map +0 -1
- package/src/plugins/use-legacy-nx-plugin/use-legacy-nx-plugin.d.ts.map +0 -1
- package/src/plugins/webpack-nx-build-coordination-plugin.d.ts.map +0 -1
- package/src/plugins/write-index-html-plugin.d.ts.map +0 -1
- package/src/utils/config.d.ts.map +0 -1
- package/src/utils/create-copy-plugin.d.ts.map +0 -1
- package/src/utils/deprecation.d.ts.map +0 -1
- package/src/utils/e2e-web-server-info-utils.d.ts.map +0 -1
- package/src/utils/ensure-dependencies.d.ts.map +0 -1
- package/src/utils/fs.d.ts.map +0 -1
- package/src/utils/get-client-environment.d.ts.map +0 -1
- package/src/utils/get-css-module-local-ident.d.ts.map +0 -1
- package/src/utils/has-plugin.d.ts.map +0 -1
- package/src/utils/hash-format.d.ts.map +0 -1
- package/src/utils/models.d.ts.map +0 -1
- package/src/utils/run-webpack.d.ts.map +0 -1
- package/src/utils/versions.d.ts +0 -8
- package/src/utils/versions.d.ts.map +0 -1
- package/src/utils/versions.js +0 -11
- package/src/utils/web-babel-loader.d.ts +0 -1
- package/src/utils/web-babel-loader.d.ts.map +0 -1
- package/src/utils/webpack/interpolate-env-variables-to-index.d.ts.map +0 -1
- package/src/utils/webpack/normalize-entry.d.ts.map +0 -1
- package/src/utils/webpack/package-chunk-sort.d.ts.map +0 -1
- package/src/utils/webpack/plugins/postcss-cli-resources.d.ts.map +0 -1
- package/src/utils/webpack/plugins/scripts-webpack-plugin.d.ts.map +0 -1
- package/src/utils/webpack/read-webpack-options.d.ts.map +0 -1
- package/src/utils/webpack/resolve-user-defined-webpack-config.d.ts.map +0 -1
- package/src/utils/with-nx.d.ts.map +0 -1
- package/src/utils/with-web.d.ts.map +0 -1
- package/tsconfig-paths-plugin.d.ts.map +0 -1
- /package/{LICENSE → dist/LICENSE} +0 -0
- /package/{app-plugin.js → dist/app-plugin.js} +0 -0
- /package/{index.js → dist/index.js} +0 -0
- /package/{plugin.js → dist/plugin.js} +0 -0
- /package/{src → dist/src}/executors/dev-server/lib/get-dev-server-config.js +0 -0
- /package/{src → dist/src}/executors/dev-server/lib/serve-path.js +0 -0
- /package/{src → dist/src}/executors/dev-server/schema.d.ts +0 -0
- /package/{src → dist/src}/executors/dev-server/schema.json +0 -0
- /package/{src → dist/src}/executors/ssr-dev-server/lib/wait-until-server-is-listening.js +0 -0
- /package/{src → dist/src}/executors/ssr-dev-server/schema.d.ts +0 -0
- /package/{src → dist/src}/executors/ssr-dev-server/schema.json +0 -0
- /package/{src → dist/src}/executors/ssr-dev-server/ssr-dev-server.impl.js +0 -0
- /package/{src → dist/src}/executors/webpack/lib/normalize-options.js +0 -0
- /package/{src → dist/src}/executors/webpack/schema.d.ts +0 -0
- /package/{src → dist/src}/executors/webpack/schema.json +0 -0
- /package/{src → dist/src}/executors/webpack/webpack.impl.js +0 -0
- /package/{src → dist/src}/generators/configuration/schema.d.ts +0 -0
- /package/{src → dist/src}/generators/configuration/schema.json +0 -0
- /package/{src → dist/src}/generators/convert-config-to-webpack-plugin/lib/extract-webpack-options.js +0 -0
- /package/{src → dist/src}/generators/convert-config-to-webpack-plugin/lib/normalize-path-options.js +0 -0
- /package/{src → dist/src}/generators/convert-config-to-webpack-plugin/lib/utils.js +0 -0
- /package/{src → dist/src}/generators/convert-config-to-webpack-plugin/lib/validate-project.js +0 -0
- /package/{src → dist/src}/generators/convert-config-to-webpack-plugin/schema.json +0 -0
- /package/{src → dist/src}/generators/convert-to-inferred/schema.json +0 -0
- /package/{src → dist/src}/generators/convert-to-inferred/utils/ast.js +0 -0
- /package/{src → dist/src}/generators/convert-to-inferred/utils/build-post-target-transformer.js +0 -0
- /package/{src → dist/src}/generators/convert-to-inferred/utils/index.js +0 -0
- /package/{src → dist/src}/generators/convert-to-inferred/utils/serve-post-target-transformer.js +0 -0
- /package/{src → dist/src}/generators/convert-to-inferred/utils/types.js +0 -0
- /package/{src → dist/src}/generators/init/schema.d.ts +0 -0
- /package/{src → dist/src}/migrations/update-21-0-0/remove-isolated-config.js +0 -0
- /package/{src → dist/src}/migrations/update-21-0-0/remove-isolated-config.md +0 -0
- /package/{src → dist/src}/migrations/update-22-0-0/remove-deprecated-options.js +0 -0
- /package/{src → dist/src}/migrations/update-23-0-0/remove-nx-tsconfig-paths-webpack-plugin-import.js +0 -0
- /package/{src → dist/src}/migrations/update-23-0-0/remove-nx-tsconfig-paths-webpack-plugin-import.md +0 -0
- /package/{src → dist/src}/plugins/generate-package-json-plugin.js +0 -0
- /package/{src → dist/src}/plugins/nx-typescript-webpack-plugin/nx-tsconfig-paths-webpack-plugin.js +0 -0
- /package/{src → dist/src}/plugins/nx-webpack-plugin/lib/apply-base-config.js +0 -0
- /package/{src → dist/src}/plugins/nx-webpack-plugin/lib/apply-web-config.js +0 -0
- /package/{src → dist/src}/plugins/nx-webpack-plugin/lib/compiler-loaders.js +0 -0
- /package/{src → dist/src}/plugins/nx-webpack-plugin/lib/get-terser-ecma-version.js +0 -0
- /package/{src → dist/src}/plugins/nx-webpack-plugin/lib/instantiate-script-plugins.js +0 -0
- /package/{src → dist/src}/plugins/nx-webpack-plugin/lib/normalize-options.js +0 -0
- /package/{src → dist/src}/plugins/nx-webpack-plugin/lib/stylesheet-loaders.js +0 -0
- /package/{src → dist/src}/plugins/nx-webpack-plugin/lib/utils.js +0 -0
- /package/{src → dist/src}/plugins/nx-webpack-plugin/nx-app-webpack-plugin-options.js +0 -0
- /package/{src → dist/src}/plugins/nx-webpack-plugin/nx-app-webpack-plugin.js +0 -0
- /package/{src → dist/src}/plugins/stats-json-plugin.js +0 -0
- /package/{src → dist/src}/plugins/use-legacy-nx-plugin/use-legacy-nx-plugin.js +0 -0
- /package/{src → dist/src}/plugins/webpack-nx-build-coordination-plugin.js +0 -0
- /package/{src → dist/src}/plugins/write-index-html-plugin.js +0 -0
- /package/{src → dist/src}/utils/create-copy-plugin.js +0 -0
- /package/{src → dist/src}/utils/e2e-web-server-info-utils.js +0 -0
- /package/{src → dist/src}/utils/fs.js +0 -0
- /package/{src → dist/src}/utils/get-client-environment.js +0 -0
- /package/{src → dist/src}/utils/get-css-module-local-ident.js +0 -0
- /package/{src → dist/src}/utils/has-plugin.js +0 -0
- /package/{src → dist/src}/utils/hash-format.js +0 -0
- /package/{src → dist/src}/utils/models.js +0 -0
- /package/{src → dist/src}/utils/run-webpack.js +0 -0
- /package/{src → dist/src}/utils/webpack/deprecated-less-loader.js +0 -0
- /package/{src → dist/src}/utils/webpack/interpolate-env-variables-to-index.js +0 -0
- /package/{src → dist/src}/utils/webpack/normalize-entry.js +0 -0
- /package/{src → dist/src}/utils/webpack/package-chunk-sort.js +0 -0
- /package/{src → dist/src}/utils/webpack/plugins/postcss-cli-resources.js +0 -0
- /package/{src → dist/src}/utils/webpack/plugins/scripts-webpack-plugin.js +0 -0
- /package/{src → dist/src}/utils/webpack/read-webpack-options.js +0 -0
- /package/{src → dist/src}/utils/webpack/resolve-user-defined-webpack-config.js +0 -0
- /package/{tsconfig-paths-plugin.js → dist/tsconfig-paths-plugin.js} +0 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { findUp, findAllNodeModules, deleteOutputDir } from './src/utils/fs';
|
|
2
|
+
export { ensureDependencies } from './src/utils/ensure-dependencies';
|
|
3
|
+
export type { EnsureDependenciesOptions } from './src/utils/ensure-dependencies';
|
|
4
|
+
export { resolveUserDefinedWebpackConfig } from './src/utils/webpack/resolve-user-defined-webpack-config';
|
|
5
|
+
export { suppressWebpackComposeHelperWarnings } from './src/utils/deprecation';
|
|
6
|
+
export { WebpackNxBuildCoordinationPlugin } from './src/plugins/webpack-nx-build-coordination-plugin';
|
|
7
|
+
export type { WebSsrDevServerOptions } from './src/executors/ssr-dev-server/schema';
|
|
8
|
+
export { default as ssrDevServerExecutor } from './src/executors/ssr-dev-server/ssr-dev-server.impl';
|
package/dist/internal.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ssrDevServerExecutor = exports.WebpackNxBuildCoordinationPlugin = exports.suppressWebpackComposeHelperWarnings = exports.resolveUserDefinedWebpackConfig = exports.ensureDependencies = exports.deleteOutputDir = exports.findAllNodeModules = exports.findUp = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
// Curated internal API surface for other first-party Nx plugins (e.g. @nx/react,
|
|
6
|
+
// @nx/angular, @nx/web, @nx/node, @nx/next, @nx/react-native). Prefer this over
|
|
7
|
+
// deep `@nx/webpack/src/*` imports — those are not part of the public API.
|
|
8
|
+
//
|
|
9
|
+
// Only truly-internal symbols belong here. Anything exported from @nx/webpack's
|
|
10
|
+
// public entry (composePluginsSync, withNx, withWeb, normalizeOptions,
|
|
11
|
+
// normalizePluginPath, devServerExecutor, NormalizedWebpackExecutorOptions, …)
|
|
12
|
+
// must be imported from '@nx/webpack', not from here.
|
|
13
|
+
var fs_1 = require("./src/utils/fs");
|
|
14
|
+
Object.defineProperty(exports, "findUp", { enumerable: true, get: function () { return fs_1.findUp; } });
|
|
15
|
+
Object.defineProperty(exports, "findAllNodeModules", { enumerable: true, get: function () { return fs_1.findAllNodeModules; } });
|
|
16
|
+
Object.defineProperty(exports, "deleteOutputDir", { enumerable: true, get: function () { return fs_1.deleteOutputDir; } });
|
|
17
|
+
var ensure_dependencies_1 = require("./src/utils/ensure-dependencies");
|
|
18
|
+
Object.defineProperty(exports, "ensureDependencies", { enumerable: true, get: function () { return ensure_dependencies_1.ensureDependencies; } });
|
|
19
|
+
var resolve_user_defined_webpack_config_1 = require("./src/utils/webpack/resolve-user-defined-webpack-config");
|
|
20
|
+
Object.defineProperty(exports, "resolveUserDefinedWebpackConfig", { enumerable: true, get: function () { return resolve_user_defined_webpack_config_1.resolveUserDefinedWebpackConfig; } });
|
|
21
|
+
var deprecation_1 = require("./src/utils/deprecation");
|
|
22
|
+
Object.defineProperty(exports, "suppressWebpackComposeHelperWarnings", { enumerable: true, get: function () { return deprecation_1.suppressWebpackComposeHelperWarnings; } });
|
|
23
|
+
var webpack_nx_build_coordination_plugin_1 = require("./src/plugins/webpack-nx-build-coordination-plugin");
|
|
24
|
+
Object.defineProperty(exports, "WebpackNxBuildCoordinationPlugin", { enumerable: true, get: function () { return webpack_nx_build_coordination_plugin_1.WebpackNxBuildCoordinationPlugin; } });
|
|
25
|
+
var ssr_dev_server_impl_1 = require("./src/executors/ssr-dev-server/ssr-dev-server.impl");
|
|
26
|
+
Object.defineProperty(exports, "ssrDevServerExecutor", { enumerable: true, get: function () { return tslib_1.__importDefault(ssr_dev_server_impl_1).default; } });
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.devServerExecutor = devServerExecutor;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
4
|
const internal_1 = require("@nx/devkit/internal");
|
|
6
|
-
const webpack_1 = tslib_1.__importDefault(require("webpack"));
|
|
7
5
|
const devkit_1 = require("@nx/devkit");
|
|
8
6
|
const operators_1 = require("rxjs/operators");
|
|
9
|
-
const webpack_dev_server_1 = tslib_1.__importDefault(require("webpack-dev-server"));
|
|
10
7
|
const get_dev_server_config_1 = require("./lib/get-dev-server-config");
|
|
11
8
|
const internal_2 = require("@nx/js/internal");
|
|
12
9
|
const run_webpack_1 = require("../../utils/run-webpack");
|
|
@@ -63,7 +60,10 @@ async function* devServerExecutor(serveOptions, context) {
|
|
|
63
60
|
config.devServer ??= devServer;
|
|
64
61
|
}
|
|
65
62
|
}
|
|
66
|
-
|
|
63
|
+
// Lazy-loaded: optional peers absent during project-graph discovery.
|
|
64
|
+
const webpack = require('webpack');
|
|
65
|
+
const WebpackDevServer = require('webpack-dev-server');
|
|
66
|
+
return yield* (0, internal_1.eachValueFrom)((0, run_webpack_1.runWebpackDevServer)(config, webpack, WebpackDevServer).pipe((0, operators_1.tap)(({ stats }) => {
|
|
67
67
|
console.info(stats.toString(config.stats));
|
|
68
68
|
}), (0, operators_1.map)(({ baseUrl, stats }) => {
|
|
69
69
|
return {
|
|
@@ -2,4 +2,3 @@ import type { Configuration as WebpackDevServerConfiguration } from 'webpack-dev
|
|
|
2
2
|
import { WebDevServerOptions } from '../schema';
|
|
3
3
|
import { NormalizedWebpackExecutorOptions } from '../../webpack/schema';
|
|
4
4
|
export declare function getDevServerOptions(root: string, serveOptions: WebDevServerOptions, buildOptions: NormalizedWebpackExecutorOptions): WebpackDevServerConfiguration;
|
|
5
|
-
//# sourceMappingURL=get-dev-server-config.d.ts.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import type { NormalizedWebpackExecutorOptions } from '../../webpack/schema';
|
|
2
2
|
export declare function buildServePath(browserOptions: NormalizedWebpackExecutorOptions): string;
|
|
3
3
|
export declare function _findDefaultServePath(baseHref?: string, deployUrl?: string): string | null;
|
|
4
|
-
//# sourceMappingURL=serve-path.d.ts.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import type { NormalizedWebpackExecutorOptions, WebpackExecutorOptions } from '../schema';
|
|
2
2
|
export declare function normalizeOptions(options: WebpackExecutorOptions, root: string, projectRoot: string, sourceRoot: string): NormalizedWebpackExecutorOptions;
|
|
3
3
|
export declare function normalizePluginPath(pluginPath: void | string, root: string): string;
|
|
4
|
-
//# sourceMappingURL=normalize-options.d.ts.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.runWebpack = runWebpack;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const webpack_1 = tslib_1.__importDefault(require("webpack"));
|
|
6
4
|
const rxjs_1 = require("rxjs");
|
|
7
5
|
// TODO(jack): move to dev-server executor
|
|
8
6
|
function runWebpack(config) {
|
|
7
|
+
// Lazy-loaded: `webpack` is an optional peer, absent during project-graph discovery.
|
|
8
|
+
const webpackImpl = require('webpack');
|
|
9
9
|
return new rxjs_1.Observable((subscriber) => {
|
|
10
10
|
// Passing `watch` option here will result in a warning due to missing callback.
|
|
11
11
|
// We manually call `.watch` or `.run` later so this option isn't needed here.
|
|
12
12
|
const { watch, ...normalizedConfig } = config;
|
|
13
|
-
const webpackCompiler = (
|
|
13
|
+
const webpackCompiler = webpackImpl(normalizedConfig);
|
|
14
14
|
const callback = (err, stats) => {
|
|
15
15
|
if (err) {
|
|
16
16
|
subscriber.error(err);
|
|
@@ -11,4 +11,3 @@ export type WebpackExecutorEvent = {
|
|
|
11
11
|
};
|
|
12
12
|
export declare function webpackExecutor(_options: WebpackExecutorOptions, context: ExecutorContext): AsyncGenerator<WebpackExecutorEvent, WebpackExecutorEvent, undefined>;
|
|
13
13
|
export default webpackExecutor;
|
|
14
|
-
//# sourceMappingURL=webpack.impl.d.ts.map
|
|
@@ -3,4 +3,3 @@ import { ConfigurationGeneratorSchema } from './schema';
|
|
|
3
3
|
export declare function configurationGenerator(tree: Tree, options: ConfigurationGeneratorSchema): Promise<GeneratorCallback>;
|
|
4
4
|
export declare function configurationGeneratorInternal(tree: Tree, options: ConfigurationGeneratorSchema): Promise<GeneratorCallback>;
|
|
5
5
|
export default configurationGenerator;
|
|
6
|
-
//# sourceMappingURL=configuration.d.ts.map
|
|
@@ -9,10 +9,12 @@ const has_plugin_1 = require("../../utils/has-plugin");
|
|
|
9
9
|
const deprecation_1 = require("../../utils/deprecation");
|
|
10
10
|
const internal_2 = require("@nx/js/internal");
|
|
11
11
|
const ensure_dependencies_1 = require("../../utils/ensure-dependencies");
|
|
12
|
+
const versions_1 = require("../../utils/versions");
|
|
12
13
|
function configurationGenerator(tree, options) {
|
|
13
14
|
return configurationGeneratorInternal(tree, { addPlugin: false, ...options });
|
|
14
15
|
}
|
|
15
16
|
async function configurationGeneratorInternal(tree, options) {
|
|
17
|
+
(0, versions_1.assertSupportedWebpackVersion)(tree);
|
|
16
18
|
const tasks = [];
|
|
17
19
|
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
18
20
|
const addPluginDefault = process.env.NX_ADD_PLUGINS !== 'false' &&
|
|
@@ -7,6 +7,7 @@ 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");
|
|
9
9
|
const validate_project_1 = require("./lib/validate-project");
|
|
10
|
+
const versions_1 = require("../../utils/versions");
|
|
10
11
|
// Make text JSON compatible
|
|
11
12
|
const preprocessText = (text) => {
|
|
12
13
|
return text
|
|
@@ -16,6 +17,7 @@ const preprocessText = (text) => {
|
|
|
16
17
|
.replace(/(\r\n|\n|\r|\t)/gm, ''); // Remove newlines and tabs
|
|
17
18
|
};
|
|
18
19
|
async function convertConfigToWebpackPluginGenerator(tree, options) {
|
|
20
|
+
(0, versions_1.assertSupportedWebpackVersion)(tree);
|
|
19
21
|
let migrated = 0;
|
|
20
22
|
const projects = (0, devkit_1.getProjects)(tree);
|
|
21
23
|
(0, internal_1.forEachExecutorOptions)(tree, '@nx/webpack:webpack', (currentTargetOptions, projectName, targetName, configurationName) => {
|
|
@@ -10,6 +10,7 @@ const versions_1 = require("../../utils/versions");
|
|
|
10
10
|
const utils_1 = require("./utils");
|
|
11
11
|
const devkit_exports_1 = require("nx/src/devkit-exports");
|
|
12
12
|
async function convertToInferred(tree, options) {
|
|
13
|
+
(0, versions_1.assertSupportedWebpackVersion)(tree);
|
|
13
14
|
const projectGraph = await (0, devkit_1.createProjectGraphAsync)();
|
|
14
15
|
const migrationContext = {
|
|
15
16
|
logger: new internal_1.AggregatedLog(),
|
|
@@ -3,4 +3,3 @@ import { Schema } from './schema';
|
|
|
3
3
|
export declare function webpackInitGenerator(tree: Tree, schema: Schema): Promise<GeneratorCallback>;
|
|
4
4
|
export declare function webpackInitGeneratorInternal(tree: Tree, schema: Schema): Promise<GeneratorCallback>;
|
|
5
5
|
export default webpackInitGenerator;
|
|
6
|
-
//# sourceMappingURL=init.d.ts.map
|
|
@@ -10,6 +10,7 @@ function webpackInitGenerator(tree, schema) {
|
|
|
10
10
|
return webpackInitGeneratorInternal(tree, { addPlugin: false, ...schema });
|
|
11
11
|
}
|
|
12
12
|
async function webpackInitGeneratorInternal(tree, schema) {
|
|
13
|
+
(0, versions_1.assertSupportedWebpackVersion)(tree);
|
|
13
14
|
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
14
15
|
const addPluginDefault = process.env.NX_ADD_PLUGINS !== 'false' &&
|
|
15
16
|
nxJson.useInferencePlugins !== false;
|
|
@@ -58,14 +59,20 @@ async function webpackInitGeneratorInternal(tree, schema) {
|
|
|
58
59
|
}
|
|
59
60
|
let installTask = () => { };
|
|
60
61
|
if (!schema.skipPackageJson) {
|
|
62
|
+
// webpack and webpack-dev-server are peer dependencies, so ensure they are
|
|
63
|
+
// installed (both the executor and inferred-plugin paths need them at the
|
|
64
|
+
// user's runtime).
|
|
61
65
|
const devDependencies = {
|
|
62
66
|
'@nx/webpack': versions_1.nxVersion,
|
|
63
67
|
'@nx/web': versions_1.nxVersion,
|
|
68
|
+
webpack: versions_1.webpackVersion,
|
|
69
|
+
'webpack-dev-server': versions_1.webpackDevServerVersion,
|
|
64
70
|
};
|
|
65
71
|
if (schema.addPlugin) {
|
|
72
|
+
// The inferred plugin runs the `webpack-cli` binary.
|
|
66
73
|
devDependencies['webpack-cli'] = versions_1.webpackCliVersion;
|
|
67
74
|
}
|
|
68
|
-
installTask = (0, devkit_1.addDependenciesToPackageJson)(tree, {}, devDependencies, undefined, schema.keepExistingVersions);
|
|
75
|
+
installTask = (0, devkit_1.addDependenciesToPackageJson)(tree, {}, devDependencies, undefined, schema.keepExistingVersions ?? true);
|
|
69
76
|
}
|
|
70
77
|
if (!schema.skipFormat) {
|
|
71
78
|
await (0, devkit_1.formatFiles)(tree);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type Tree } from '@nx/devkit';
|
|
2
|
+
export default function migrateCreateNodesV2ToCreateNodes(tree: Tree): Promise<void>;
|
|
3
|
+
/**
|
|
4
|
+
* Rewrites named imports and re-exports of `createNodesV2` to `createNodes`
|
|
5
|
+
* when they come from one of the given module specifiers. Only the named
|
|
6
|
+
* bindings are touched — the module specifier, the `import`/`export` keyword,
|
|
7
|
+
* any `type` modifier, and any default import are left untouched.
|
|
8
|
+
*/
|
|
9
|
+
export declare function rewriteCreateNodesV2Imports(source: string, specifiers: ReadonlySet<string>): string;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = migrateCreateNodesV2ToCreateNodes;
|
|
4
|
+
exports.rewriteCreateNodesV2Imports = rewriteCreateNodesV2Imports;
|
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
|
+
const TS_EXTENSIONS = ['.ts', '.tsx', '.cts', '.mts'];
|
|
7
|
+
const DEPRECATED_NAME = 'createNodesV2';
|
|
8
|
+
const CANONICAL_NAME = 'createNodes';
|
|
9
|
+
// Module specifiers from which `@nx/webpack` publicly exposes `createNodesV2`.
|
|
10
|
+
// A named import or re-export of `createNodesV2` from one of these is rewritten
|
|
11
|
+
// to the canonical `createNodes` export.
|
|
12
|
+
const TARGET_SPECIFIERS = new Set(['@nx/webpack/plugin']);
|
|
13
|
+
let ts;
|
|
14
|
+
async function migrateCreateNodesV2ToCreateNodes(tree) {
|
|
15
|
+
let touchedCount = 0;
|
|
16
|
+
(0, devkit_1.visitNotIgnoredFiles)(tree, '.', (filePath) => {
|
|
17
|
+
if (!TS_EXTENSIONS.some((ext) => filePath.endsWith(ext))) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const original = tree.read(filePath, 'utf-8');
|
|
21
|
+
if (!original || !original.includes(DEPRECATED_NAME)) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const updated = rewriteCreateNodesV2Imports(original, TARGET_SPECIFIERS);
|
|
25
|
+
if (updated !== original) {
|
|
26
|
+
tree.write(filePath, updated);
|
|
27
|
+
touchedCount += 1;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
if (touchedCount > 0) {
|
|
31
|
+
devkit_1.logger.info(`Renamed \`${DEPRECATED_NAME}\` imports to \`${CANONICAL_NAME}\` in ${touchedCount} file(s).`);
|
|
32
|
+
}
|
|
33
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Rewrites named imports and re-exports of `createNodesV2` to `createNodes`
|
|
37
|
+
* when they come from one of the given module specifiers. Only the named
|
|
38
|
+
* bindings are touched — the module specifier, the `import`/`export` keyword,
|
|
39
|
+
* any `type` modifier, and any default import are left untouched.
|
|
40
|
+
*/
|
|
41
|
+
function rewriteCreateNodesV2Imports(source, specifiers) {
|
|
42
|
+
ts ??= (0, devkit_1.ensurePackage)('typescript', '*');
|
|
43
|
+
const sourceFile = ts.createSourceFile('tmp.ts', source, ts.ScriptTarget.Latest,
|
|
44
|
+
/* setParentNodes */ true, ts.ScriptKind.TSX);
|
|
45
|
+
const changes = [];
|
|
46
|
+
for (const stmt of sourceFile.statements) {
|
|
47
|
+
if (ts.isImportDeclaration(stmt)) {
|
|
48
|
+
collectImportRewrite(sourceFile, stmt, specifiers, changes);
|
|
49
|
+
}
|
|
50
|
+
else if (ts.isExportDeclaration(stmt)) {
|
|
51
|
+
collectExportRewrite(sourceFile, stmt, specifiers, changes);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return changes.length > 0 ? (0, devkit_1.applyChangesToString)(source, changes) : source;
|
|
55
|
+
}
|
|
56
|
+
function isTargetSpecifier(node, specifiers) {
|
|
57
|
+
return ts.isStringLiteral(node) && specifiers.has(node.text);
|
|
58
|
+
}
|
|
59
|
+
function collectImportRewrite(sourceFile, stmt, specifiers, changes) {
|
|
60
|
+
if (!isTargetSpecifier(stmt.moduleSpecifier, specifiers)) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const namedBindings = stmt.importClause?.namedBindings;
|
|
64
|
+
// Only `import { ... }` carries renameable named bindings. `import x`,
|
|
65
|
+
// `import * as ns`, and side-effect imports reference the module wholesale
|
|
66
|
+
// and keep working through the `createNodesV2` runtime alias, so we leave
|
|
67
|
+
// them be. A mixed `import def, { createNodesV2 }` still has its named
|
|
68
|
+
// bindings rewritten below — the default binding is untouched.
|
|
69
|
+
if (!namedBindings || !ts.isNamedImports(namedBindings)) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
rewriteNamedBindings(sourceFile, namedBindings, changes);
|
|
73
|
+
}
|
|
74
|
+
function collectExportRewrite(sourceFile, stmt, specifiers, changes) {
|
|
75
|
+
if (!stmt.moduleSpecifier ||
|
|
76
|
+
!isTargetSpecifier(stmt.moduleSpecifier, specifiers)) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
// `export { ... } from '...'` can be rewritten; `export * from '...'` has no
|
|
80
|
+
// named bindings to rename.
|
|
81
|
+
if (!stmt.exportClause || !ts.isNamedExports(stmt.exportClause)) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
rewriteNamedBindings(sourceFile, stmt.exportClause, changes);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Re-renders the `{ ... }` of a named import/export, renaming any
|
|
88
|
+
* `createNodesV2` specifier to `createNodes`. If renaming would collide with a
|
|
89
|
+
* `createNodes` that is already present (e.g. `{ createNodes, createNodesV2 }`),
|
|
90
|
+
* the duplicate is dropped. Returns without recording a change when the binding
|
|
91
|
+
* list contains no `createNodesV2`.
|
|
92
|
+
*/
|
|
93
|
+
function rewriteNamedBindings(sourceFile, namedBindings, changes) {
|
|
94
|
+
const elements = namedBindings.elements;
|
|
95
|
+
const hasDeprecated = elements.some((el) => (el.propertyName ?? el.name).text === DEPRECATED_NAME);
|
|
96
|
+
if (!hasDeprecated) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
const seen = new Set();
|
|
100
|
+
const rendered = [];
|
|
101
|
+
for (const el of elements) {
|
|
102
|
+
const text = renderSpecifier(el);
|
|
103
|
+
if (!seen.has(text)) {
|
|
104
|
+
seen.add(text);
|
|
105
|
+
rendered.push(text);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
const start = namedBindings.getStart(sourceFile);
|
|
109
|
+
changes.push({
|
|
110
|
+
type: devkit_1.ChangeType.Delete,
|
|
111
|
+
start,
|
|
112
|
+
length: namedBindings.getEnd() - start,
|
|
113
|
+
}, {
|
|
114
|
+
type: devkit_1.ChangeType.Insert,
|
|
115
|
+
index: start,
|
|
116
|
+
text: `{ ${rendered.join(', ')} }`,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
function renderSpecifier(el) {
|
|
120
|
+
const typePrefix = el.isTypeOnly ? 'type ' : '';
|
|
121
|
+
const rename = (name) => name === DEPRECATED_NAME ? CANONICAL_NAME : name;
|
|
122
|
+
// `{ name }` — no alias, so the local binding follows the rename.
|
|
123
|
+
if (!el.propertyName) {
|
|
124
|
+
return `${typePrefix}${rename(el.name.text)}`;
|
|
125
|
+
}
|
|
126
|
+
// `{ propertyName as name }` — only the imported (left) side is renamed; the
|
|
127
|
+
// local alias is preserved. A now-redundant alias such as
|
|
128
|
+
// `createNodesV2 as createNodes` collapses to `createNodes`.
|
|
129
|
+
const canonicalImported = rename(el.propertyName.text);
|
|
130
|
+
const localName = el.name.text;
|
|
131
|
+
return canonicalImported === localName
|
|
132
|
+
? `${typePrefix}${localName}`
|
|
133
|
+
: `${typePrefix}${canonicalImported} as ${localName}`;
|
|
134
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#### Rename `createNodesV2` imports to `createNodes`
|
|
2
|
+
|
|
3
|
+
`@nx/webpack` renamed its primary inferred-plugin export from `createNodesV2` to `createNodes`. The `createNodesV2` name is preserved as a deprecated alias for now, but new code should use `createNodes`.
|
|
4
|
+
|
|
5
|
+
This migration scans every `.ts`, `.tsx`, `.cts`, and `.mts` file in your workspace and rewrites named imports and re-exports of `createNodesV2` from `@nx/webpack/plugin` to `createNodes`.
|
|
6
|
+
|
|
7
|
+
#### Sample Code Changes
|
|
8
|
+
|
|
9
|
+
##### Before
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { createNodesV2 } from '@nx/webpack/plugin';
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
##### After
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import { createNodes } from '@nx/webpack/plugin';
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Aliases are preserved (`createNodesV2 as cn` becomes `createNodes as cn`), and if a file already imports both names (`{ createNodes, createNodesV2 }`) the redundant binding is dropped.
|
|
22
|
+
|
|
23
|
+
#### What is not rewritten
|
|
24
|
+
|
|
25
|
+
Only static `import`/`export` named bindings from `@nx/webpack/plugin` are rewritten. Namespace imports, dynamic `import(...)`, `require(...)` destructuring, and property access such as `plugin.createNodesV2` are left untouched — they keep working through the `createNodesV2` runtime alias. Update those by hand if you want to drop the deprecated name everywhere.
|