@nuxt/rspack-builder 3.15.3 → 3.16.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.
- package/README.md +1 -2
- package/dist/index.mjs +20 -16
- package/package.json +16 -16
package/README.md
CHANGED
|
@@ -32,7 +32,6 @@ It provides a number of features that make it easy to build fast, SEO-friendly,
|
|
|
32
32
|
- 🧩 [Modules](#modules)
|
|
33
33
|
- ❤️ [Contribute](#contribute)
|
|
34
34
|
- 🏠 [Local Development](#local-development)
|
|
35
|
-
- ⛰️ [Nuxt 2](#nuxt-2)
|
|
36
35
|
- 🛟 [Professional Support](#professional-support)
|
|
37
36
|
- 🔗 [Follow Us](#follow-us)
|
|
38
37
|
- ⚖️ [License](#license)
|
|
@@ -44,7 +43,7 @@ It provides a number of features that make it easy to build fast, SEO-friendly,
|
|
|
44
43
|
Use the following command to create a new starter project. This will create a starter project with all the necessary files and dependencies:
|
|
45
44
|
|
|
46
45
|
```bash
|
|
47
|
-
|
|
46
|
+
npm create nuxt <my-project>
|
|
48
47
|
```
|
|
49
48
|
|
|
50
49
|
> [!TIP]
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import pify from 'pify';
|
|
2
|
-
import { fromNodeMiddleware, defineEventHandler, handleCors, setHeader } from 'h3';
|
|
2
|
+
import { fromNodeMiddleware, defineEventHandler, handleCors, getRequestHeader, createError, setHeader } from 'h3';
|
|
3
3
|
import webpackDevMiddleware from 'webpack-dev-middleware';
|
|
4
4
|
import webpackHotMiddleware from 'webpack-hot-middleware';
|
|
5
5
|
import { defu } from 'defu';
|
|
@@ -13,7 +13,7 @@ import { createFsFromVolume, Volume } from 'memfs';
|
|
|
13
13
|
import querystring from 'node:querystring';
|
|
14
14
|
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
|
|
15
15
|
import ForkTSCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
|
|
16
|
-
import {
|
|
16
|
+
import { defineEnv } from 'unenv';
|
|
17
17
|
import TimeFixPlugin from 'time-fix-plugin';
|
|
18
18
|
import FriendlyErrorsWebpackPlugin from '@nuxt/friendly-errors-webpack-plugin';
|
|
19
19
|
import escapeRegExp from 'escape-string-regexp';
|
|
@@ -47,7 +47,7 @@ ${options.globalPublicPath} = buildAssetsURL();
|
|
|
47
47
|
`);
|
|
48
48
|
return {
|
|
49
49
|
code: s.toString(),
|
|
50
|
-
map: options.sourcemap ? s.generateMap({ hires: true }) :
|
|
50
|
+
map: options.sourcemap ? s.generateMap({ hires: true }) : void 0
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
53
|
};
|
|
@@ -542,7 +542,7 @@ function createCssLoadersRule(ctx, cssLoaderOptions) {
|
|
|
542
542
|
if (ctx.userConfig.extractCSS) {
|
|
543
543
|
if (ctx.isServer) {
|
|
544
544
|
if (cssLoader.options.modules) {
|
|
545
|
-
cssLoader.options.modules.exportOnlyLocals
|
|
545
|
+
cssLoader.options.modules.exportOnlyLocals ??= true;
|
|
546
546
|
}
|
|
547
547
|
return [cssLoader];
|
|
548
548
|
}
|
|
@@ -671,9 +671,7 @@ class VueSSRClientPlugin {
|
|
|
671
671
|
if (Array.isArray(m.modules)) {
|
|
672
672
|
for (const concatenatedModule of m.modules) {
|
|
673
673
|
const id2 = hash(concatenatedModule.identifier.replace(/\s\w+$/, ""));
|
|
674
|
-
|
|
675
|
-
webpackManifest.modules[id2] = files;
|
|
676
|
-
}
|
|
674
|
+
webpackManifest.modules[id2] ||= files;
|
|
677
675
|
}
|
|
678
676
|
}
|
|
679
677
|
if (stats.modules) {
|
|
@@ -736,7 +734,7 @@ class VueSSRServerPlugin {
|
|
|
736
734
|
stats.assets.forEach((asset) => {
|
|
737
735
|
if (isJS(asset.name)) {
|
|
738
736
|
const queryPart = extractQueryPartJS(asset.name);
|
|
739
|
-
if (queryPart !==
|
|
737
|
+
if (queryPart !== void 0) {
|
|
740
738
|
bundle.files[asset.name] = asset.name.replace(queryPart, "");
|
|
741
739
|
} else {
|
|
742
740
|
bundle.files[asset.name] = asset.name;
|
|
@@ -784,7 +782,7 @@ function vue(ctx) {
|
|
|
784
782
|
ctx.config.plugins.push(new webpack.DefinePlugin({
|
|
785
783
|
"__VUE_OPTIONS_API__": "true",
|
|
786
784
|
"__VUE_PROD_DEVTOOLS__": "false",
|
|
787
|
-
"__VUE_PROD_HYDRATION_MISMATCH_DETAILS__": ctx.nuxt.options.debug
|
|
785
|
+
"__VUE_PROD_HYDRATION_MISMATCH_DETAILS__": ctx.nuxt.options.debug && ctx.nuxt.options.debug.hydration
|
|
788
786
|
}));
|
|
789
787
|
}
|
|
790
788
|
|
|
@@ -838,7 +836,10 @@ function clientNodeCompat(ctx) {
|
|
|
838
836
|
ctx.config.plugins.push(new webpack.DefinePlugin({ global: "globalThis" }));
|
|
839
837
|
ctx.config.resolve ||= {};
|
|
840
838
|
ctx.config.resolve.fallback = {
|
|
841
|
-
...
|
|
839
|
+
...defineEnv({
|
|
840
|
+
nodeCompat: true,
|
|
841
|
+
resolve: true
|
|
842
|
+
}).env.alias,
|
|
842
843
|
...ctx.config.resolve.fallback
|
|
843
844
|
};
|
|
844
845
|
ctx.config.plugins.unshift(new webpack.NormalModuleReplacementPlugin(/node:/, (resource) => {
|
|
@@ -975,15 +976,15 @@ function serverStandalone(ctx) {
|
|
|
975
976
|
}
|
|
976
977
|
ctx.config.externals.push(({ request }, cb) => {
|
|
977
978
|
if (!request) {
|
|
978
|
-
return cb(
|
|
979
|
+
return cb(void 0, false);
|
|
979
980
|
}
|
|
980
981
|
if (external.includes(request)) {
|
|
981
|
-
return cb(
|
|
982
|
+
return cb(void 0, true);
|
|
982
983
|
}
|
|
983
984
|
if (request[0] === "." || isAbsolute(request) || inline.find((prefix) => typeof prefix === "string" && request.startsWith(prefix)) || assetPattern.test(request)) {
|
|
984
|
-
return cb(
|
|
985
|
+
return cb(void 0, false);
|
|
985
986
|
}
|
|
986
|
-
return cb(
|
|
987
|
+
return cb(void 0, true);
|
|
987
988
|
});
|
|
988
989
|
}
|
|
989
990
|
function serverPlugins(ctx) {
|
|
@@ -1060,7 +1061,7 @@ async function createDevMiddleware(compiler) {
|
|
|
1060
1061
|
const hotHandler = fromNodeMiddleware(hotMiddleware);
|
|
1061
1062
|
await nuxt.callHook("server:devHandler", defineEventHandler(async (event) => {
|
|
1062
1063
|
const body = await devHandler(event);
|
|
1063
|
-
if (body !==
|
|
1064
|
+
if (body !== void 0) {
|
|
1064
1065
|
return body;
|
|
1065
1066
|
}
|
|
1066
1067
|
await hotHandler(event);
|
|
@@ -1073,6 +1074,9 @@ function wdmToH3Handler(devMiddleware, corsOptions) {
|
|
|
1073
1074
|
if (isPreflight) {
|
|
1074
1075
|
return null;
|
|
1075
1076
|
}
|
|
1077
|
+
if (getRequestHeader(event, "sec-fetch-mode") === "no-cors" && getRequestHeader(event, "sec-fetch-site") === "cross-site") {
|
|
1078
|
+
throw createError({ statusCode: 403 });
|
|
1079
|
+
}
|
|
1076
1080
|
setHeader(event, "Vary", "Origin");
|
|
1077
1081
|
event.context.webpack = {
|
|
1078
1082
|
...event.context.webpack,
|
|
@@ -1093,7 +1097,7 @@ function wdmToH3Handler(devMiddleware, corsOptions) {
|
|
|
1093
1097
|
if (err) {
|
|
1094
1098
|
reject(err);
|
|
1095
1099
|
} else {
|
|
1096
|
-
resolve(
|
|
1100
|
+
resolve(void 0);
|
|
1097
1101
|
}
|
|
1098
1102
|
});
|
|
1099
1103
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxt/rspack-builder",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.16.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/nuxt/nuxt.git",
|
|
@@ -27,36 +27,36 @@
|
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@nuxt/friendly-errors-webpack-plugin": "^2.6.0",
|
|
30
|
-
"@rspack/core": "^1.2.
|
|
30
|
+
"@rspack/core": "^1.2.7",
|
|
31
31
|
"autoprefixer": "^10.4.20",
|
|
32
32
|
"css-loader": "^7.1.2",
|
|
33
|
-
"css-minimizer-webpack-plugin": "^7.0.
|
|
33
|
+
"css-minimizer-webpack-plugin": "^7.0.2",
|
|
34
34
|
"cssnano": "^7.0.6",
|
|
35
35
|
"defu": "^6.1.4",
|
|
36
|
-
"esbuild-loader": "^4.
|
|
36
|
+
"esbuild-loader": "^4.3.0",
|
|
37
37
|
"escape-string-regexp": "^5.0.0",
|
|
38
38
|
"file-loader": "^6.2.0",
|
|
39
39
|
"fork-ts-checker-webpack-plugin": "^9.0.2",
|
|
40
|
-
"globby": "^14.0
|
|
41
|
-
"h3": "^1.
|
|
40
|
+
"globby": "^14.1.0",
|
|
41
|
+
"h3": "^1.15.1",
|
|
42
42
|
"jiti": "^2.4.2",
|
|
43
43
|
"knitwork": "^1.2.0",
|
|
44
44
|
"magic-string": "^0.30.17",
|
|
45
|
-
"memfs": "^4.
|
|
46
|
-
"ohash": "^
|
|
47
|
-
"pathe": "^2.0.
|
|
45
|
+
"memfs": "^4.17.0",
|
|
46
|
+
"ohash": "^2.0.11",
|
|
47
|
+
"pathe": "^2.0.3",
|
|
48
48
|
"pify": "^6.1.0",
|
|
49
|
-
"postcss": "^8.5.
|
|
49
|
+
"postcss": "^8.5.3",
|
|
50
50
|
"postcss-import": "^16.1.0",
|
|
51
51
|
"postcss-import-resolver": "^2.0.0",
|
|
52
52
|
"postcss-loader": "^8.1.1",
|
|
53
53
|
"postcss-url": "^10.1.3",
|
|
54
54
|
"pug-plain-loader": "^1.1.0",
|
|
55
|
-
"std-env": "^3.8.
|
|
55
|
+
"std-env": "^3.8.1",
|
|
56
56
|
"time-fix-plugin": "^2.0.7",
|
|
57
57
|
"ufo": "^1.5.4",
|
|
58
|
-
"unenv": "^
|
|
59
|
-
"unplugin": "^2.
|
|
58
|
+
"unenv": "^2.0.0-rc.12",
|
|
59
|
+
"unplugin": "^2.2.0",
|
|
60
60
|
"url-loader": "^4.1.1",
|
|
61
61
|
"vue-bundle-renderer": "^2.1.1",
|
|
62
62
|
"vue-loader": "^17.4.2",
|
|
@@ -64,16 +64,16 @@
|
|
|
64
64
|
"webpack-dev-middleware": "^7.4.2",
|
|
65
65
|
"webpack-hot-middleware": "^2.26.1",
|
|
66
66
|
"webpackbar": "^7.0.0",
|
|
67
|
-
"@nuxt/kit": "3.
|
|
67
|
+
"@nuxt/kit": "3.16.0"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@types/pify": "5.0.4",
|
|
71
71
|
"@types/webpack-bundle-analyzer": "4.7.0",
|
|
72
72
|
"@types/webpack-hot-middleware": "2.25.9",
|
|
73
|
-
"rollup": "4.
|
|
73
|
+
"rollup": "4.34.9",
|
|
74
74
|
"unbuild": "latest",
|
|
75
75
|
"vue": "3.5.13",
|
|
76
|
-
"@nuxt/schema": "3.
|
|
76
|
+
"@nuxt/schema": "3.16.0"
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
|
79
79
|
"vue": "^3.3.4"
|