@nuxt/rspack-builder 3.19.3 → 3.20.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/README.md +4 -4
- package/dist/index.mjs +25 -16
- package/package.json +14 -13
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
[](https://nuxt.com)
|
|
2
2
|
|
|
3
3
|
# Nuxt
|
|
4
4
|
|
|
5
5
|
<p>
|
|
6
6
|
<a href="https://www.npmjs.com/package/nuxt"><img src="https://img.shields.io/npm/v/nuxt.svg?style=flat&colorA=18181B&colorB=28CF8D" alt="Version"></a>
|
|
7
7
|
<a href="https://www.npmjs.com/package/nuxt"><img src="https://img.shields.io/npm/dm/nuxt.svg?style=flat&colorA=18181B&colorB=28CF8D" alt="Downloads"></a>
|
|
8
|
-
<a href="https://github.com/nuxt/nuxt/
|
|
8
|
+
<a href="https://github.com/nuxt/nuxt/blob/main/LICENSE"><img src="https://img.shields.io/github/license/nuxt/nuxt.svg?style=flat&colorA=18181B&colorB=28CF8D" alt="License"></a>
|
|
9
9
|
<a href="https://nuxt.com"><img src="https://img.shields.io/badge/Nuxt%20Docs-18181B?logo=nuxt" alt="Website"></a>
|
|
10
10
|
<a href="https://chat.nuxt.dev"><img src="https://img.shields.io/badge/Nuxt%20Discord-18181B?logo=discord" alt="Discord"></a>
|
|
11
11
|
<a href="https://securityscorecards.dev/"><img src="https://api.securityscorecards.dev/projects/github.com/nuxt/nuxt/badge" alt="Nuxt openssf scorecard score"></a>
|
|
@@ -109,9 +109,9 @@ Follow the docs to [Set Up Your Local Development Environment](https://nuxt.com/
|
|
|
109
109
|
## <a name="follow-us">🔗 Follow Us</a>
|
|
110
110
|
|
|
111
111
|
<p valign="center">
|
|
112
|
-
<a href="https://go.nuxt.com/discord"><img width="20px" src="https://github.com/nuxt/nuxt/
|
|
112
|
+
<a href="https://go.nuxt.com/discord"><img width="20px" src="https://github.com/nuxt/nuxt/blob/main/.github/assets/discord.svg" alt="Discord"></a> <a href="https://go.nuxt.com/x"><img width="20px" src="https://github.com/nuxt/nuxt/blob/main/.github/assets/twitter.svg" alt="Twitter"></a> <a href="https://go.nuxt.com/github"><img width="20px" src="https://github.com/nuxt/nuxt/blob/main/.github/assets/github.svg" alt="GitHub"></a> <a href="https://go.nuxt.com/bluesky"><img width="20px" src="https://github.com/nuxt/nuxt/blob/main/.github/assets/bluesky.svg" alt="Bluesky"></a>
|
|
113
113
|
</p>
|
|
114
114
|
|
|
115
115
|
## <a name="license">⚖️ License</a>
|
|
116
116
|
|
|
117
|
-
[MIT](https://github.com/nuxt/nuxt/
|
|
117
|
+
[MIT](https://github.com/nuxt/nuxt/blob/main/LICENSE)
|
package/dist/index.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import { logger, useNitro, useNuxt } from '@nuxt/kit';
|
|
|
8
8
|
import { createUnplugin } from 'unplugin';
|
|
9
9
|
import MagicString from 'magic-string';
|
|
10
10
|
import { webpack, WebpackBarPlugin, builder, MiniCssExtractPlugin, TsCheckerPlugin } from '#builder';
|
|
11
|
-
import { join, resolve, normalize,
|
|
11
|
+
import { join, resolve, normalize, isAbsolute } from 'pathe';
|
|
12
12
|
import { createFsFromVolume, Volume } from 'memfs';
|
|
13
13
|
import querystring from 'node:querystring';
|
|
14
14
|
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
|
|
@@ -24,8 +24,9 @@ import createResolver from 'postcss-import-resolver';
|
|
|
24
24
|
import { createJiti } from 'jiti';
|
|
25
25
|
import VueLoaderPlugin from 'vue-loader/dist/pluginWebpack5.js';
|
|
26
26
|
import { mkdir, writeFile } from 'node:fs/promises';
|
|
27
|
-
import { normalizeWebpackManifest } from 'vue-bundle-renderer';
|
|
27
|
+
import { normalizeWebpackManifest, precomputeDependencies } from 'vue-bundle-renderer';
|
|
28
28
|
import { hash } from 'ohash';
|
|
29
|
+
import { serialize } from 'seroval';
|
|
29
30
|
|
|
30
31
|
const defaults = {
|
|
31
32
|
globalPublicPath: "__webpack_public_path__",
|
|
@@ -472,6 +473,17 @@ function getEnv(ctx) {
|
|
|
472
473
|
"import.meta.client": ctx.isClient,
|
|
473
474
|
"import.meta.server": ctx.isServer
|
|
474
475
|
};
|
|
476
|
+
if (ctx.isClient) {
|
|
477
|
+
_env["process.prerender"] = false;
|
|
478
|
+
_env["process.nitro"] = false;
|
|
479
|
+
_env["import.meta.prerender"] = false;
|
|
480
|
+
_env["import.meta.nitro"] = false;
|
|
481
|
+
} else {
|
|
482
|
+
_env["process.prerender"] = "(()=>process.prerender)()";
|
|
483
|
+
_env["process.nitro"] = "(()=>process.nitro)()";
|
|
484
|
+
_env["import.meta.prerender"] = "(()=>import.meta.prerender)()";
|
|
485
|
+
_env["import.meta.nitro"] = "(()=>import.meta.nitro)()";
|
|
486
|
+
}
|
|
475
487
|
if (ctx.userConfig.aggressiveCodeRemoval) {
|
|
476
488
|
_env["typeof process"] = JSON.stringify(ctx.isServer ? "object" : "undefined");
|
|
477
489
|
_env["typeof window"] = _env["typeof document"] = JSON.stringify(!ctx.isServer ? "object" : "undefined");
|
|
@@ -700,11 +712,11 @@ async function createPostcssLoadersRule(ctx) {
|
|
|
700
712
|
}
|
|
701
713
|
|
|
702
714
|
class VueSSRClientPlugin {
|
|
703
|
-
|
|
715
|
+
serverDist;
|
|
716
|
+
nuxt;
|
|
704
717
|
constructor(options) {
|
|
705
|
-
this.
|
|
706
|
-
|
|
707
|
-
}, options);
|
|
718
|
+
this.serverDist = resolve(options.nuxt.options.buildDir, "dist/server");
|
|
719
|
+
this.nuxt = options.nuxt;
|
|
708
720
|
}
|
|
709
721
|
apply(compiler) {
|
|
710
722
|
compiler.hooks.afterEmit.tap("VueSSRClientPlugin", async (compilation) => {
|
|
@@ -795,12 +807,12 @@ class VueSSRClientPlugin {
|
|
|
795
807
|
}
|
|
796
808
|
}
|
|
797
809
|
const manifest = normalizeWebpackManifest(webpackManifest);
|
|
798
|
-
await this.
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
await writeFile(this.
|
|
802
|
-
|
|
803
|
-
await writeFile(this.
|
|
810
|
+
await this.nuxt.callHook("build:manifest", manifest);
|
|
811
|
+
await mkdir(this.serverDist, { recursive: true });
|
|
812
|
+
const precomputed = precomputeDependencies(manifest);
|
|
813
|
+
await writeFile(join(this.serverDist, `client.manifest.json`), JSON.stringify(manifest, null, 2));
|
|
814
|
+
await writeFile(join(this.serverDist, "client.manifest.mjs"), "export default " + serialize(manifest), "utf8");
|
|
815
|
+
await writeFile(join(this.serverDist, "client.precomputed.mjs"), "export default " + serialize(precomputed), "utf8");
|
|
804
816
|
});
|
|
805
817
|
}
|
|
806
818
|
}
|
|
@@ -882,10 +894,7 @@ function vue(ctx) {
|
|
|
882
894
|
options: ctx.userConfig.loaders.vue
|
|
883
895
|
});
|
|
884
896
|
if (ctx.isClient) {
|
|
885
|
-
ctx.config.plugins.push(new VueSSRClientPlugin({
|
|
886
|
-
filename: resolve(ctx.options.buildDir, "dist/server", `${ctx.name}.manifest.json`),
|
|
887
|
-
nuxt: ctx.nuxt
|
|
888
|
-
}));
|
|
897
|
+
ctx.config.plugins.push(new VueSSRClientPlugin({ nuxt: ctx.nuxt }));
|
|
889
898
|
} else {
|
|
890
899
|
ctx.config.plugins.push(new VueSSRServerPlugin({
|
|
891
900
|
filename: `${ctx.name}.manifest.json`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxt/rspack-builder",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.20.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/nuxt/nuxt.git",
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@nuxt/friendly-errors-webpack-plugin": "^2.6.0",
|
|
30
|
-
"@rspack/core": "^1.
|
|
30
|
+
"@rspack/core": "^1.6.1",
|
|
31
31
|
"autoprefixer": "^10.4.21",
|
|
32
32
|
"css-loader": "^7.1.2",
|
|
33
33
|
"css-minimizer-webpack-plugin": "^7.0.2",
|
|
34
|
-
"cssnano": "^7.1.
|
|
34
|
+
"cssnano": "^7.1.2",
|
|
35
35
|
"defu": "^6.1.4",
|
|
36
36
|
"esbuild-loader": "^4.4.0",
|
|
37
37
|
"escape-string-regexp": "^5.0.0",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"h3": "^1.15.4",
|
|
40
40
|
"jiti": "^2.6.1",
|
|
41
41
|
"knitwork": "^1.2.0",
|
|
42
|
-
"magic-string": "^0.30.
|
|
43
|
-
"memfs": "^4.
|
|
42
|
+
"magic-string": "^0.30.21",
|
|
43
|
+
"memfs": "^4.50.0",
|
|
44
44
|
"ohash": "^2.0.11",
|
|
45
45
|
"pathe": "^2.0.3",
|
|
46
46
|
"pify": "^6.1.0",
|
|
@@ -50,11 +50,12 @@
|
|
|
50
50
|
"postcss-loader": "^8.2.0",
|
|
51
51
|
"postcss-url": "^10.1.3",
|
|
52
52
|
"pug-plain-loader": "^1.1.0",
|
|
53
|
-
"
|
|
53
|
+
"seroval": "^1.3.2",
|
|
54
|
+
"std-env": "^3.10.0",
|
|
54
55
|
"time-fix-plugin": "^2.0.7",
|
|
55
|
-
"ts-checker-rspack-plugin": "^1.
|
|
56
|
+
"ts-checker-rspack-plugin": "^1.2.0",
|
|
56
57
|
"ufo": "^1.6.1",
|
|
57
|
-
"unenv": "^2.0.0-rc.
|
|
58
|
+
"unenv": "^2.0.0-rc.24",
|
|
58
59
|
"unplugin": "^2.3.10",
|
|
59
60
|
"url-loader": "^4.1.1",
|
|
60
61
|
"vue-bundle-renderer": "^2.2.0",
|
|
@@ -63,16 +64,16 @@
|
|
|
63
64
|
"webpack-dev-middleware": "^7.4.5",
|
|
64
65
|
"webpack-hot-middleware": "^2.26.1",
|
|
65
66
|
"webpackbar": "^7.0.0",
|
|
66
|
-
"@nuxt/kit": "3.
|
|
67
|
+
"@nuxt/kit": "3.20.1"
|
|
67
68
|
},
|
|
68
69
|
"devDependencies": {
|
|
69
70
|
"@types/pify": "6.1.0",
|
|
70
71
|
"@types/webpack-bundle-analyzer": "4.7.0",
|
|
71
|
-
"@types/webpack-hot-middleware": "2.25.
|
|
72
|
-
"rollup": "4.52.
|
|
72
|
+
"@types/webpack-hot-middleware": "2.25.12",
|
|
73
|
+
"rollup": "4.52.5",
|
|
73
74
|
"unbuild": "3.6.1",
|
|
74
|
-
"vue": "3.5.
|
|
75
|
-
"@nuxt/schema": "3.
|
|
75
|
+
"vue": "3.5.23",
|
|
76
|
+
"@nuxt/schema": "3.20.1"
|
|
76
77
|
},
|
|
77
78
|
"peerDependencies": {
|
|
78
79
|
"vue": "^3.3.4"
|