@nuxt/rspack-builder-nightly 4.3.0-29437273.f9c092c5 → 4.3.0-29439165.ec1da219
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/dist/index.mjs +50 -4
- package/package.json +6 -3
package/dist/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import webpackDevMiddleware from 'webpack-dev-middleware';
|
|
|
4
4
|
import webpackHotMiddleware from 'webpack-hot-middleware';
|
|
5
5
|
import { defu } from 'defu';
|
|
6
6
|
import { joinURL } from 'ufo';
|
|
7
|
-
import { logger, useNitro, useNuxt } from '@nuxt/kit';
|
|
7
|
+
import { logger, tryImportModule, directoryToURL, resolveAlias, 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';
|
|
@@ -27,6 +27,9 @@ import { mkdir, writeFile } from 'node:fs/promises';
|
|
|
27
27
|
import { normalizeWebpackManifest, precomputeDependencies } from 'vue-bundle-renderer';
|
|
28
28
|
import { hash } from 'ohash';
|
|
29
29
|
import { serialize } from 'seroval';
|
|
30
|
+
import { parseNodeModulePath } from 'mlly';
|
|
31
|
+
import { resolveModulePath } from 'exsolve';
|
|
32
|
+
import { runtimeDependencies } from 'nuxt/meta';
|
|
30
33
|
|
|
31
34
|
const defaults = {
|
|
32
35
|
globalPublicPath: "__webpack_public_path__",
|
|
@@ -1049,6 +1052,7 @@ function node(ctx) {
|
|
|
1049
1052
|
}
|
|
1050
1053
|
|
|
1051
1054
|
const assetPattern = /\.(?:css|s[ca]ss|png|jpe?g|gif|svg|woff2?|eot|ttf|otf|webp|webm|mp4|ogv)(?:\?.*)?$/i;
|
|
1055
|
+
const VIRTUAL_RE = /^\0?virtual:(?:nuxt:)?/;
|
|
1052
1056
|
async function server(ctx) {
|
|
1053
1057
|
ctx.name = "server";
|
|
1054
1058
|
ctx.isServer = true;
|
|
@@ -1073,7 +1077,7 @@ function serverPreset(ctx) {
|
|
|
1073
1077
|
minimize: false
|
|
1074
1078
|
};
|
|
1075
1079
|
}
|
|
1076
|
-
function serverStandalone(ctx) {
|
|
1080
|
+
async function serverStandalone(ctx) {
|
|
1077
1081
|
const inline = [
|
|
1078
1082
|
"src/",
|
|
1079
1083
|
"#app",
|
|
@@ -1087,13 +1091,24 @@ function serverStandalone(ctx) {
|
|
|
1087
1091
|
"#",
|
|
1088
1092
|
...ctx.options.build.transpile
|
|
1089
1093
|
];
|
|
1094
|
+
const { runtimeDependencies: runtimeNitroDependencies = [] } = await tryImportModule("nitropack/runtime/meta", {
|
|
1095
|
+
url: new URL(import.meta.url)
|
|
1096
|
+
}) || {};
|
|
1090
1097
|
const external = /* @__PURE__ */ new Set([
|
|
1091
1098
|
"nitro/runtime",
|
|
1092
1099
|
// TODO: remove in v5
|
|
1093
1100
|
"#internal/nitro",
|
|
1094
1101
|
"nitropack/runtime",
|
|
1095
1102
|
"#shared",
|
|
1096
|
-
resolve(ctx.nuxt.options.rootDir, ctx.nuxt.options.dir.shared)
|
|
1103
|
+
resolve(ctx.nuxt.options.rootDir, ctx.nuxt.options.dir.shared),
|
|
1104
|
+
// explicit dependencies we use in our ssr renderer
|
|
1105
|
+
"unhead",
|
|
1106
|
+
"@unhead/vue",
|
|
1107
|
+
"@nuxt/devalue",
|
|
1108
|
+
"rou3",
|
|
1109
|
+
"unstorage",
|
|
1110
|
+
...runtimeDependencies,
|
|
1111
|
+
...runtimeNitroDependencies
|
|
1097
1112
|
]);
|
|
1098
1113
|
if (!ctx.nuxt.options.dev) {
|
|
1099
1114
|
external.add("#internal/nuxt/paths");
|
|
@@ -1103,16 +1118,47 @@ function serverStandalone(ctx) {
|
|
|
1103
1118
|
if (!Array.isArray(ctx.config.externals)) {
|
|
1104
1119
|
return;
|
|
1105
1120
|
}
|
|
1106
|
-
|
|
1121
|
+
const conditions = [
|
|
1122
|
+
ctx.nuxt.options.dev ? "development" : "production",
|
|
1123
|
+
"node",
|
|
1124
|
+
"import",
|
|
1125
|
+
"require"
|
|
1126
|
+
];
|
|
1127
|
+
ctx.config.externals.push(({ request, context }, cb) => {
|
|
1107
1128
|
if (!request) {
|
|
1108
1129
|
return cb(void 0, false);
|
|
1109
1130
|
}
|
|
1110
1131
|
if (external.has(request)) {
|
|
1132
|
+
const resolved = resolveModulePath(request, {
|
|
1133
|
+
from: context ? [context, ...ctx.nuxt.options.modulesDir].map((d) => directoryToURL(d)) : ctx.nuxt.options.modulesDir.map((d) => directoryToURL(d)),
|
|
1134
|
+
suffixes: ["", "index"],
|
|
1135
|
+
conditions,
|
|
1136
|
+
try: true
|
|
1137
|
+
});
|
|
1138
|
+
if (resolved && isAbsolute(resolved)) {
|
|
1139
|
+
return cb(void 0, resolved);
|
|
1140
|
+
}
|
|
1111
1141
|
return cb(void 0, true);
|
|
1112
1142
|
}
|
|
1113
1143
|
if (request[0] === "." || isAbsolute(request) || inline.find((prefix) => typeof prefix === "string" && request.startsWith(prefix)) || assetPattern.test(request)) {
|
|
1114
1144
|
return cb(void 0, false);
|
|
1115
1145
|
}
|
|
1146
|
+
if (context && request && !request.startsWith("node:") && (isAbsolute(context) || VIRTUAL_RE.test(context))) {
|
|
1147
|
+
try {
|
|
1148
|
+
const normalisedRequest = resolveAlias(normalize(request), ctx.nuxt.options.alias);
|
|
1149
|
+
const dir = parseNodeModulePath(context).dir || ctx.nuxt.options.rootDir;
|
|
1150
|
+
const resolved = resolveModulePath(normalisedRequest, {
|
|
1151
|
+
from: [dir, ...ctx.nuxt.options.modulesDir].map((d) => directoryToURL(d)),
|
|
1152
|
+
suffixes: ["", "index"],
|
|
1153
|
+
conditions,
|
|
1154
|
+
try: true
|
|
1155
|
+
});
|
|
1156
|
+
if (resolved && isAbsolute(resolved)) {
|
|
1157
|
+
return cb(void 0, false);
|
|
1158
|
+
}
|
|
1159
|
+
} catch {
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1116
1162
|
return cb(void 0, true);
|
|
1117
1163
|
});
|
|
1118
1164
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxt/rspack-builder-nightly",
|
|
3
|
-
"version": "4.3.0-
|
|
3
|
+
"version": "4.3.0-29439165.ec1da219",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/nuxt/nuxt.git",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@nuxt/friendly-errors-webpack-plugin": "^2.6.0",
|
|
30
|
-
"@nuxt/kit": "npm:@nuxt/kit-nightly@4.3.0-
|
|
30
|
+
"@nuxt/kit": "npm:@nuxt/kit-nightly@4.3.0-29439165.ec1da219",
|
|
31
31
|
"@rspack/core": "^1.6.7",
|
|
32
32
|
"autoprefixer": "^10.4.23",
|
|
33
33
|
"css-loader": "^7.1.2",
|
|
@@ -36,12 +36,14 @@
|
|
|
36
36
|
"defu": "^6.1.4",
|
|
37
37
|
"esbuild-loader": "^4.4.0",
|
|
38
38
|
"escape-string-regexp": "^5.0.0",
|
|
39
|
+
"exsolve": "^1.0.8",
|
|
39
40
|
"file-loader": "^6.2.0",
|
|
40
41
|
"h3": "^1.15.4",
|
|
41
42
|
"jiti": "^2.6.1",
|
|
42
43
|
"knitwork": "^1.3.0",
|
|
43
44
|
"magic-string": "^0.30.21",
|
|
44
45
|
"memfs": "^4.51.1",
|
|
46
|
+
"mlly": "^1.8.0",
|
|
45
47
|
"ohash": "^2.0.11",
|
|
46
48
|
"pathe": "^2.0.3",
|
|
47
49
|
"pify": "^6.1.0",
|
|
@@ -68,7 +70,7 @@
|
|
|
68
70
|
"webpackbar": "^7.0.0"
|
|
69
71
|
},
|
|
70
72
|
"devDependencies": {
|
|
71
|
-
"@nuxt/schema": "npm:@nuxt/schema-nightly@4.3.0-
|
|
73
|
+
"@nuxt/schema": "npm:@nuxt/schema-nightly@4.3.0-29439165.ec1da219",
|
|
72
74
|
"@types/webpack-bundle-analyzer": "4.7.0",
|
|
73
75
|
"@types/webpack-hot-middleware": "2.25.12",
|
|
74
76
|
"rollup": "4.53.4",
|
|
@@ -76,6 +78,7 @@
|
|
|
76
78
|
"vue": "3.5.25"
|
|
77
79
|
},
|
|
78
80
|
"peerDependencies": {
|
|
81
|
+
"nuxt": "npm:nuxt-nightly@4.3.0-29439165.ec1da219",
|
|
79
82
|
"vue": "^3.3.4"
|
|
80
83
|
},
|
|
81
84
|
"engines": {
|