@nuxt/webpack-builder 3.4.2 → 3.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.mjs +13 -10
  2. package/package.json +17 -16
package/dist/index.mjs CHANGED
@@ -22,6 +22,7 @@ import { cloneDeep, defaults as defaults$1, merge, uniq } from 'lodash-es';
22
22
  import TimeFixPlugin from 'time-fix-plugin';
23
23
  import WebpackBar from 'webpackbar';
24
24
  import FriendlyErrorsWebpackPlugin from '@nuxt/friendly-errors-webpack-plugin';
25
+ import { isTest } from 'std-env';
25
26
  import { EsbuildPlugin } from 'esbuild-loader';
26
27
  import MiniCssExtractPlugin from 'mini-css-extract-plugin';
27
28
  import CssMinimizerPlugin from 'css-minimizer-webpack-plugin';
@@ -248,16 +249,14 @@ function fileName(ctx, key) {
248
249
  return fileName2;
249
250
  }
250
251
  function getWebpackConfig(ctx) {
251
- const { options, config } = ctx;
252
- const builder = {};
253
- const loaders = [];
254
- const { extend } = options.build;
252
+ const { extend } = ctx.options.build;
255
253
  if (typeof extend === "function") {
254
+ logger.warn("[nuxt] The `build.extend` and `webpack.build.extend` properties have been deprecated in Nuxt 3 for some time and will be removed in a future minor release. Instead, you can extend webpack config using the `webpack:config` hook.");
256
255
  const extendedConfig = extend.call(
257
- builder,
258
- config,
259
- { loaders, ...ctx }
260
- ) || config;
256
+ {},
257
+ ctx.config,
258
+ { loaders: [], ...ctx }
259
+ ) || ctx.config;
261
260
  const pragma = /@|#/;
262
261
  const { devtool } = extendedConfig;
263
262
  if (typeof devtool === "string" && pragma.test(devtool)) {
@@ -266,7 +265,7 @@ function getWebpackConfig(ctx) {
266
265
  }
267
266
  return extendedConfig;
268
267
  }
269
- return cloneDeep(config);
268
+ return cloneDeep(ctx.config);
270
269
  }
271
270
 
272
271
  function assets(ctx) {
@@ -482,6 +481,7 @@ function getEnv(ctx) {
482
481
  "process.env.NODE_ENV": JSON.stringify(ctx.config.mode),
483
482
  "process.mode": JSON.stringify(ctx.config.mode),
484
483
  "process.dev": options.dev,
484
+ "process.test": isTest,
485
485
  __NUXT_VERSION__: JSON.stringify(ctx.nuxt._version),
486
486
  "process.env.VUE_ENV": JSON.stringify(ctx.name),
487
487
  "process.browser": ctx.isClient,
@@ -1119,7 +1119,7 @@ async function bundle(nuxt) {
1119
1119
  });
1120
1120
  await nuxt.callHook("webpack:config", webpackConfigs);
1121
1121
  const mfs = nuxt.options.dev ? createMFS() : null;
1122
- const compilers = webpackConfigs.map((config) => {
1122
+ for (const config of webpackConfigs) {
1123
1123
  config.plugins.push(DynamicBasePlugin.webpack({
1124
1124
  sourcemap: nuxt.options.sourcemap[config.name]
1125
1125
  }));
@@ -1131,6 +1131,9 @@ async function bundle(nuxt) {
1131
1131
  rootDir: nuxt.options.rootDir,
1132
1132
  composables: nuxt.options.optimization.keyedComposables
1133
1133
  }));
1134
+ }
1135
+ await nuxt.callHook("webpack:configResolved", webpackConfigs);
1136
+ const compilers = webpackConfigs.map((config) => {
1134
1137
  const compiler = webpack(config);
1135
1138
  if (nuxt.options.dev) {
1136
1139
  compiler.outputFileSystem = mfs;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/webpack-builder",
3
- "version": "3.4.2",
3
+ "version": "3.5.0",
4
4
  "repository": "nuxt/nuxt",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -20,40 +20,41 @@
20
20
  "autoprefixer": "^10.4.14",
21
21
  "css-loader": "^6.7.3",
22
22
  "css-minimizer-webpack-plugin": "^5.0.0",
23
- "cssnano": "^6.0.0",
23
+ "cssnano": "^6.0.1",
24
24
  "esbuild-loader": "^3.0.1",
25
25
  "escape-string-regexp": "^5.0.0",
26
26
  "estree-walker": "^3.0.3",
27
27
  "file-loader": "^6.2.0",
28
28
  "fork-ts-checker-webpack-plugin": "^8.0.0",
29
29
  "fs-extra": "^11.1.1",
30
- "h3": "^1.6.4",
30
+ "h3": "^1.6.6",
31
31
  "hash-sum": "^2.0.0",
32
32
  "lodash-es": "^4.17.21",
33
33
  "magic-string": "^0.30.0",
34
- "memfs": "^3.5.0",
34
+ "memfs": "^3.5.1",
35
35
  "mini-css-extract-plugin": "^2.7.5",
36
- "mlly": "^1.2.0",
37
- "ohash": "^1.1.1",
36
+ "mlly": "^1.2.1",
37
+ "ohash": "^1.1.2",
38
38
  "pathe": "^1.1.0",
39
39
  "pify": "^6.1.0",
40
40
  "postcss": "^8.4.23",
41
41
  "postcss-import": "^15.1.0",
42
- "postcss-loader": "^7.2.4",
42
+ "postcss-loader": "^7.3.0",
43
43
  "postcss-url": "^10.1.3",
44
+ "std-env": "^3.3.3",
44
45
  "time-fix-plugin": "^2.0.7",
45
- "ufo": "^1.1.1",
46
+ "ufo": "^1.1.2",
46
47
  "unplugin": "^1.3.1",
47
48
  "url-loader": "^4.1.1",
48
49
  "vue-bundle-renderer": "^1.0.3",
49
- "vue-loader": "^17.0.1",
50
- "webpack": "^5.80.0",
50
+ "vue-loader": "^17.1.1",
51
+ "webpack": "^5.82.1",
51
52
  "webpack-bundle-analyzer": "^4.8.0",
52
- "webpack-dev-middleware": "^6.0.2",
53
+ "webpack-dev-middleware": "^6.1.0",
53
54
  "webpack-hot-middleware": "^2.25.3",
54
55
  "webpack-virtual-modules": "^0.5.0",
55
56
  "webpackbar": "^5.0.2",
56
- "@nuxt/kit": "3.4.2"
57
+ "@nuxt/kit": "3.5.0"
57
58
  },
58
59
  "devDependencies": {
59
60
  "@types/lodash-es": "^4.17.7",
@@ -62,14 +63,14 @@
62
63
  "@types/webpack-hot-middleware": "^2.25.6",
63
64
  "@types/webpack-virtual-modules": "^0.1.1",
64
65
  "unbuild": "latest",
65
- "vue": "3.2.47",
66
- "@nuxt/schema": "3.4.2"
66
+ "vue": "3.3.2",
67
+ "@nuxt/schema": "3.5.0"
67
68
  },
68
69
  "peerDependencies": {
69
- "vue": "^3.2.47"
70
+ "vue": "^3.3.2"
70
71
  },
71
72
  "engines": {
72
- "node": "^14.18.0 || ^16.10.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
73
+ "node": "^14.18.0 || >=16.10.0"
73
74
  },
74
75
  "scripts": {}
75
76
  }