@nuxt/rspack-builder 3.15.0 → 3.15.2

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 +15 -19
  2. package/package.json +9 -11
package/dist/index.mjs CHANGED
@@ -14,7 +14,6 @@ import querystring from 'node:querystring';
14
14
  import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
15
15
  import ForkTSCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
16
16
  import { env, nodeless } from 'unenv';
17
- import { cloneDeep } from 'lodash-es';
18
17
  import TimeFixPlugin from 'time-fix-plugin';
19
18
  import FriendlyErrorsWebpackPlugin from '@nuxt/friendly-errors-webpack-plugin';
20
19
  import escapeRegExp from 'escape-string-regexp';
@@ -48,7 +47,7 @@ ${options.globalPublicPath} = buildAssetsURL();
48
47
  `);
49
48
  return {
50
49
  code: s.toString(),
51
- map: options.sourcemap ? s.generateMap({ hires: true }) : void 0
50
+ map: options.sourcemap ? s.generateMap({ hires: true }) : undefined
52
51
  };
53
52
  }
54
53
  };
@@ -128,9 +127,6 @@ function fileName(ctx, key) {
128
127
  }
129
128
  return fileName2;
130
129
  }
131
- function getWebpackConfig(ctx) {
132
- return cloneDeep(ctx.config);
133
- }
134
130
 
135
131
  function assets(ctx) {
136
132
  ctx.config.module.rules.push(
@@ -189,7 +185,7 @@ async function base(ctx) {
189
185
  ]);
190
186
  }
191
187
  function baseConfig(ctx) {
192
- ctx.config = {
188
+ ctx.config = defu({}, {
193
189
  name: ctx.name,
194
190
  entry: { app: [resolve(ctx.options.appDir, ctx.options.experimental.asyncEntry ? "entry.async" : "entry")] },
195
191
  module: { rules: [] },
@@ -207,10 +203,10 @@ function baseConfig(ctx) {
207
203
  output: getOutput(ctx),
208
204
  stats: statsMap[ctx.nuxt.options.logLevel] ?? statsMap.info,
209
205
  ...ctx.config
210
- };
206
+ });
211
207
  }
212
208
  function basePlugins(ctx) {
213
- ctx.config.plugins = ctx.config.plugins || [];
209
+ ctx.config.plugins ||= [];
214
210
  if (ctx.options.dev) {
215
211
  if (ctx.nuxt.options.builder !== "@nuxt/rspack-builder") {
216
212
  ctx.config.plugins.push(new TimeFixPlugin());
@@ -740,7 +736,7 @@ class VueSSRServerPlugin {
740
736
  stats.assets.forEach((asset) => {
741
737
  if (isJS(asset.name)) {
742
738
  const queryPart = extractQueryPartJS(asset.name);
743
- if (queryPart !== void 0) {
739
+ if (queryPart !== undefined) {
744
740
  bundle.files[asset.name] = asset.name.replace(queryPart, "");
745
741
  } else {
746
742
  bundle.files[asset.name] = asset.name;
@@ -840,7 +836,7 @@ function clientNodeCompat(ctx) {
840
836
  return;
841
837
  }
842
838
  ctx.config.plugins.push(new webpack.DefinePlugin({ global: "globalThis" }));
843
- ctx.config.resolve = ctx.config.resolve || {};
839
+ ctx.config.resolve ||= {};
844
840
  ctx.config.resolve.fallback = {
845
841
  ...env(nodeless).alias,
846
842
  ...ctx.config.resolve.fallback
@@ -869,7 +865,7 @@ function clientHMR(ctx) {
869
865
  // https://github.com/glenjamin/webpack-hot-middleware#config
870
866
  `webpack-hot-middleware/client?${hotMiddlewareClientOptionsStr}`
871
867
  );
872
- ctx.config.plugins = ctx.config.plugins || [];
868
+ ctx.config.plugins ||= [];
873
869
  ctx.config.plugins.push(new webpack.HotModuleReplacementPlugin());
874
870
  }
875
871
  function clientOptimization(_ctx) {
@@ -979,19 +975,19 @@ function serverStandalone(ctx) {
979
975
  }
980
976
  ctx.config.externals.push(({ request }, cb) => {
981
977
  if (!request) {
982
- return cb(void 0, false);
978
+ return cb(undefined, false);
983
979
  }
984
980
  if (external.includes(request)) {
985
- return cb(void 0, true);
981
+ return cb(undefined, true);
986
982
  }
987
983
  if (request[0] === "." || isAbsolute(request) || inline.find((prefix) => typeof prefix === "string" && request.startsWith(prefix)) || assetPattern.test(request)) {
988
- return cb(void 0, false);
984
+ return cb(undefined, false);
989
985
  }
990
- return cb(void 0, true);
986
+ return cb(undefined, true);
991
987
  });
992
988
  }
993
989
  function serverPlugins(ctx) {
994
- ctx.config.plugins = ctx.config.plugins || [];
990
+ ctx.config.plugins ||= [];
995
991
  if (ctx.userConfig.serverURLPolyfill) {
996
992
  ctx.config.plugins.push(new webpack.ProvidePlugin({
997
993
  URL: [ctx.userConfig.serverURLPolyfill, "URL"],
@@ -1010,7 +1006,7 @@ const bundle = async (nuxt) => {
1010
1006
  const ctx = createWebpackConfigContext(nuxt);
1011
1007
  ctx.userConfig = defu(nuxt.options.webpack[`$${preset.name}`], ctx.userConfig);
1012
1008
  await applyPresets(ctx, preset);
1013
- return getWebpackConfig(ctx);
1009
+ return ctx.config;
1014
1010
  }));
1015
1011
  await nuxt.callHook(`${builder}:config`, webpackConfigs);
1016
1012
  const mfs = nuxt.options.dev ? createMFS() : null;
@@ -1064,7 +1060,7 @@ async function createDevMiddleware(compiler) {
1064
1060
  const hotHandler = fromNodeMiddleware(hotMiddleware);
1065
1061
  await nuxt.callHook("server:devHandler", defineEventHandler(async (event) => {
1066
1062
  const body = await devHandler(event);
1067
- if (body !== void 0) {
1063
+ if (body !== undefined) {
1068
1064
  return body;
1069
1065
  }
1070
1066
  await hotHandler(event);
@@ -1092,7 +1088,7 @@ function wdmToH3Handler(devMiddleware) {
1092
1088
  if (err) {
1093
1089
  reject(err);
1094
1090
  } else {
1095
- resolve(void 0);
1091
+ resolve(undefined);
1096
1092
  }
1097
1093
  });
1098
1094
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/rspack-builder",
3
- "version": "3.15.0",
3
+ "version": "3.15.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/nuxt/nuxt.git",
@@ -38,16 +38,15 @@
38
38
  "file-loader": "^6.2.0",
39
39
  "fork-ts-checker-webpack-plugin": "^9.0.2",
40
40
  "globby": "^14.0.2",
41
- "h3": "^1.13.0",
41
+ "h3": "^1.13.1",
42
42
  "jiti": "^2.4.2",
43
43
  "knitwork": "^1.2.0",
44
- "lodash-es": "4.17.21",
45
44
  "magic-string": "^0.30.17",
46
45
  "memfs": "^4.14.1",
47
46
  "ohash": "^1.1.4",
48
- "pathe": "^1.1.2",
47
+ "pathe": "^2.0.1",
49
48
  "pify": "^6.1.0",
50
- "postcss": "^8.4.49",
49
+ "postcss": "^8.5.1",
51
50
  "postcss-import": "^16.1.0",
52
51
  "postcss-import-resolver": "^2.0.0",
53
52
  "postcss-loader": "^8.1.1",
@@ -57,7 +56,7 @@
57
56
  "time-fix-plugin": "^2.0.7",
58
57
  "ufo": "^1.5.4",
59
58
  "unenv": "^1.10.0",
60
- "unplugin": "^2.1.0",
59
+ "unplugin": "^2.1.2",
61
60
  "url-loader": "^4.1.1",
62
61
  "vue-bundle-renderer": "^2.1.1",
63
62
  "vue-loader": "^17.4.2",
@@ -65,23 +64,22 @@
65
64
  "webpack-dev-middleware": "^7.4.2",
66
65
  "webpack-hot-middleware": "^2.26.1",
67
66
  "webpackbar": "^7.0.0",
68
- "@nuxt/kit": "3.15.0"
67
+ "@nuxt/kit": "3.15.2"
69
68
  },
70
69
  "devDependencies": {
71
- "@types/lodash-es": "4.17.12",
72
70
  "@types/pify": "5.0.4",
73
71
  "@types/webpack-bundle-analyzer": "4.7.0",
74
72
  "@types/webpack-hot-middleware": "2.25.9",
75
- "rollup": "4.29.1",
73
+ "rollup": "4.30.1",
76
74
  "unbuild": "latest",
77
75
  "vue": "3.5.13",
78
- "@nuxt/schema": "3.15.0"
76
+ "@nuxt/schema": "3.15.2"
79
77
  },
80
78
  "peerDependencies": {
81
79
  "vue": "^3.3.4"
82
80
  },
83
81
  "engines": {
84
- "node": "^18.20.5 || ^20.9.0 || >=22.0.0"
82
+ "node": "^18.12.0 || ^20.9.0 || >=22.0.0"
85
83
  },
86
84
  "scripts": {
87
85
  "test:attw": "attw --pack"