@nx/webpack 16.10.0 → 17.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/webpack",
3
- "version": "16.10.0",
3
+ "version": "17.0.0-beta.1",
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": {
@@ -62,9 +62,9 @@
62
62
  "webpack-dev-server": "^4.9.3",
63
63
  "webpack-node-externals": "^3.0.0",
64
64
  "webpack-subresource-integrity": "^5.1.0",
65
- "@nx/devkit": "16.10.0",
66
- "@nx/js": "16.10.0",
67
- "@nrwl/webpack": "16.10.0"
65
+ "@nx/devkit": "17.0.0-beta.1",
66
+ "@nx/js": "17.0.0-beta.1",
67
+ "@nrwl/webpack": "17.0.0-beta.1"
68
68
  },
69
69
  "publishConfig": {
70
70
  "access": "public"
@@ -11,6 +11,7 @@ const buildable_libs_utils_1 = require("@nx/js/src/utils/buildable-libs-utils");
11
11
  const run_webpack_1 = require("../../utils/run-webpack");
12
12
  const custom_webpack_1 = require("../../utils/webpack/custom-webpack");
13
13
  const normalize_options_1 = require("../webpack/lib/normalize-options");
14
+ const path_1 = require("path");
14
15
  async function* devServerExecutor(serveOptions, context) {
15
16
  // Default to dev mode so builds are faster and HMR mode works better.
16
17
  process.env.NODE_ENV ??= 'development';
@@ -26,7 +27,10 @@ async function* devServerExecutor(serveOptions, context) {
26
27
  }
27
28
  let config = (0, get_dev_server_config_1.getDevServerConfig)(context, buildOptions, serveOptions);
28
29
  if (buildOptions.webpackConfig) {
29
- let customWebpack = (0, custom_webpack_1.resolveCustomWebpackConfig)(buildOptions.webpackConfig, buildOptions.tsConfig);
30
+ let tsconfigPath = buildOptions.tsConfig.startsWith(context.root)
31
+ ? buildOptions.tsConfig
32
+ : (0, path_1.join)(context.root, buildOptions.tsConfig);
33
+ let customWebpack = (0, custom_webpack_1.resolveCustomWebpackConfig)(buildOptions.webpackConfig, tsconfigPath);
30
34
  if (typeof customWebpack.then === 'function') {
31
35
  customWebpack = await customWebpack;
32
36
  }
@@ -46,7 +46,6 @@ class WriteIndexHtmlPlugin {
46
46
  for (const file of chunk.files) {
47
47
  files.push({
48
48
  // The id is guaranteed to exist at this point in the compilation process
49
- // tslint:disable-next-line: no-non-null-assertion
50
49
  id: chunk.id.toString(),
51
50
  name: chunk.name,
52
51
  file,
@@ -12,7 +12,9 @@ function runWebpackDevServer(config, webpack, WebpackDevServer) {
12
12
  const devServerConfig = config.devServer || {};
13
13
  const originalOnListen = devServerConfig.onListening;
14
14
  devServerConfig.onListening = function (server) {
15
- originalOnListen(server);
15
+ if (typeof originalOnListen === 'function') {
16
+ originalOnListen(server);
17
+ }
16
18
  const devServerOptions = server.options;
17
19
  baseUrl = `${server.options.https ? 'https' : 'http'}://${server.options.host}:${server.options.port}${devServerOptions.devMiddleware.publicPath}`;
18
20
  };
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isRegistered = exports.resolveCustomWebpackConfig = void 0;
4
4
  const internal_1 = require("@nx/js/src/internal");
5
5
  function resolveCustomWebpackConfig(path, tsConfig) {
6
- const cleanupTranspiler = (0, internal_1.registerTsProject)(path, tsConfig);
6
+ const cleanupTranspiler = (0, internal_1.registerTsProject)(tsConfig);
7
7
  const customWebpackConfig = require(path);
8
8
  cleanupTranspiler();
9
9
  // If the user provides a configuration in TS file
@@ -130,7 +130,6 @@ function PostcssCliResources(options) {
130
130
  // We want to load it relative to the file that imports
131
131
  const inputFile = decl.source && decl.source.input.file;
132
132
  const context = (inputFile && path.dirname(inputFile)) || loader.context;
133
- // tslint:disable-next-line:no-conditional-assignment
134
133
  while ((match = urlRegex.exec(value))) {
135
134
  const originalUrl = match[1] || match[2] || match[3];
136
135
  let processedUrl;