@nuxt/rspack-builder 4.3.0 → 4.4.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.
- package/README.md +5 -5
- package/dist/THIRD-PARTY-LICENSES.md +46 -0
- package/dist/index.mjs +134 -141
- package/dist/loaders/vue-module-identifier.mjs +1 -4
- package/package.json +25 -25
package/README.md
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
<a href="https://nuxt.com"><img width="830" height="213" src="https://github.com/nuxt/nuxt/blob/main/.github/assets/banner.svg" alt="Nuxt banner"></a>
|
|
2
2
|
|
|
3
3
|
# Nuxt
|
|
4
4
|
|
|
5
5
|
<p>
|
|
6
|
-
<a href="https://
|
|
7
|
-
<a href="https://
|
|
6
|
+
<a href="https://npmx.dev/package/nuxt"><img src="https://npmx.dev/api/registry/badge/version/nuxt" alt="Version"></a>
|
|
7
|
+
<a href="https://npmx.dev/package/nuxt"><img src="https://npmx.dev/api/registry/badge/downloads/nuxt" alt="Downloads"></a>
|
|
8
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/modules"><img src="https://img.shields.io/badge/dynamic/json?url=https://nuxt.com/api/v1/modules&query=$.stats.modules&label=Modules&style=flat&colorA=18181B&colorB=28CF8D" alt="Modules"></a>
|
|
10
10
|
<a href="https://nuxt.com"><img src="https://img.shields.io/badge/Nuxt%20Docs-18181B?logo=nuxt" alt="Website"></a>
|
|
11
11
|
<a href="https://chat.nuxt.dev"><img src="https://img.shields.io/badge/Nuxt%20Discord-18181B?logo=discord" alt="Discord"></a>
|
|
12
|
-
<a href="https://securityscorecards.dev/"><img src="https://api.securityscorecards.dev/projects/github.com/nuxt/nuxt/badge" alt="Nuxt openssf scorecard score"></a>
|
|
12
|
+
<a href="https://securityscorecards.dev/viewer/?uri=github.com/nuxt/nuxt"><img src="https://api.securityscorecards.dev/projects/github.com/nuxt/nuxt/badge" alt="Nuxt openssf scorecard score"></a>
|
|
13
13
|
<a href="https://deepwiki.com/nuxt/nuxt"><img src="https://deepwiki.com/badge.svg" alt="Ask DeepWiki"></a>
|
|
14
14
|
</p>
|
|
15
15
|
|
|
@@ -111,7 +111,7 @@ Follow the docs to [Set Up Your Local Development Environment](https://nuxt.com/
|
|
|
111
111
|
## <a name="follow-us">🔗 Follow Us</a>
|
|
112
112
|
|
|
113
113
|
<p valign="center">
|
|
114
|
-
<a href="https://go.nuxt.com/discord"><img width="
|
|
114
|
+
<a href="https://go.nuxt.com/discord"><img width="20" src="https://github.com/nuxt/nuxt/blob/main/.github/assets/discord.svg" alt="Discord"></a> <a href="https://go.nuxt.com/x"><img width="20" src="https://github.com/nuxt/nuxt/blob/main/.github/assets/twitter.svg" alt="Twitter"></a> <a href="https://go.nuxt.com/github"><img width="20" src="https://github.com/nuxt/nuxt/blob/main/.github/assets/github.svg" alt="GitHub"></a> <a href="https://go.nuxt.com/bluesky"><img width="20" src="https://github.com/nuxt/nuxt/blob/main/.github/assets/bluesky.svg" alt="Bluesky"></a>
|
|
115
115
|
</p>
|
|
116
116
|
|
|
117
117
|
## <a name="license">⚖️ License</a>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Licenses of Bundled Dependencies
|
|
2
|
+
|
|
3
|
+
The published artifact additionally contains code with the following licenses:
|
|
4
|
+
MIT
|
|
5
|
+
|
|
6
|
+
# Bundled Dependencies
|
|
7
|
+
|
|
8
|
+
## @nuxt/webpack-builder
|
|
9
|
+
|
|
10
|
+
License: MIT
|
|
11
|
+
Repository: https://github.com/nuxt/nuxt
|
|
12
|
+
|
|
13
|
+
---------------------------------------
|
|
14
|
+
|
|
15
|
+
## nuxt
|
|
16
|
+
|
|
17
|
+
License: MIT
|
|
18
|
+
Repository: https://github.com/nuxt/nuxt
|
|
19
|
+
|
|
20
|
+
> The MIT License (MIT)
|
|
21
|
+
>
|
|
22
|
+
> Copyright (c) 2016-present - Nuxt Team
|
|
23
|
+
>
|
|
24
|
+
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
25
|
+
> of this software and associated documentation files (the "Software"), to deal
|
|
26
|
+
> in the Software without restriction, including without limitation the rights
|
|
27
|
+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
28
|
+
> copies of the Software, and to permit persons to whom the Software is
|
|
29
|
+
> furnished to do so, subject to the following conditions:
|
|
30
|
+
>
|
|
31
|
+
> The above copyright notice and this permission notice shall be included in all
|
|
32
|
+
> copies or substantial portions of the Software.
|
|
33
|
+
>
|
|
34
|
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
35
|
+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
36
|
+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
37
|
+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
38
|
+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
39
|
+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
40
|
+
> SOFTWARE.
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
## @nuxt/webpack-builder
|
|
44
|
+
|
|
45
|
+
License: MIT
|
|
46
|
+
Repository: https://github.com/nuxt/nuxt
|
package/dist/index.mjs
CHANGED
|
@@ -3,13 +3,12 @@ import pify from "pify";
|
|
|
3
3
|
import webpackDevMiddleware from "webpack-dev-middleware";
|
|
4
4
|
import webpackHotMiddleware from "webpack-hot-middleware";
|
|
5
5
|
import { defu } from "defu";
|
|
6
|
-
import { joinURL,
|
|
6
|
+
import { joinURL, withTrailingSlash } from "ufo";
|
|
7
7
|
import { directoryToURL, logger, resolveAlias, useNitro, useNuxt } from "@nuxt/kit";
|
|
8
8
|
import { createUnplugin } from "unplugin";
|
|
9
9
|
import MagicString from "magic-string";
|
|
10
10
|
import { MiniCssExtractPlugin, TsCheckerPlugin, WebpackBarPlugin, builder, webpack } from "#builder";
|
|
11
11
|
import { existsSync, readFileSync } from "node:fs";
|
|
12
|
-
import { pathToFileURL } from "node:url";
|
|
13
12
|
import { basename, isAbsolute, join, normalize, relative, resolve } from "pathe";
|
|
14
13
|
import { genArrayFromRaw, genObjectFromRawEntries, genString } from "knitwork";
|
|
15
14
|
import { compileStyle, parse } from "@vue/compiler-sfc";
|
|
@@ -33,7 +32,6 @@ import { normalizeWebpackManifest, precomputeDependencies } from "vue-bundle-ren
|
|
|
33
32
|
import { hash } from "ohash";
|
|
34
33
|
import { serialize } from "seroval";
|
|
35
34
|
import { parseNodeModulePath } from "mlly";
|
|
36
|
-
|
|
37
35
|
//#region ../webpack/src/plugins/dynamic-base.ts
|
|
38
36
|
const defaults = {
|
|
39
37
|
globalPublicPath: "__webpack_public_path__",
|
|
@@ -64,7 +62,6 @@ const DynamicBasePlugin = createUnplugin((options = {}) => {
|
|
|
64
62
|
}
|
|
65
63
|
};
|
|
66
64
|
});
|
|
67
|
-
|
|
68
65
|
//#endregion
|
|
69
66
|
//#region ../webpack/src/plugins/chunk.ts
|
|
70
67
|
const pluginName = "ChunkErrorPlugin";
|
|
@@ -98,22 +95,40 @@ if (typeof ${ensureChunk} !== "undefined") {
|
|
|
98
95
|
`;
|
|
99
96
|
}
|
|
100
97
|
};
|
|
101
|
-
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region ../nuxt/src/core/utils/plugins.ts
|
|
100
|
+
/**
|
|
101
|
+
* Split a bundler module ID into its pathname and search (query) parts.
|
|
102
|
+
*
|
|
103
|
+
* Module IDs from Vite/webpack are already-normalized filesystem paths
|
|
104
|
+
* that may carry query strings (e.g. `?vue&type=style&lang=css`).
|
|
105
|
+
*/
|
|
106
|
+
function parseModuleId(id) {
|
|
107
|
+
const qIndex = id.indexOf("?");
|
|
108
|
+
if (qIndex === -1) return {
|
|
109
|
+
pathname: id,
|
|
110
|
+
search: ""
|
|
111
|
+
};
|
|
112
|
+
return {
|
|
113
|
+
pathname: id.slice(0, qIndex),
|
|
114
|
+
search: id.slice(qIndex)
|
|
115
|
+
};
|
|
116
|
+
}
|
|
102
117
|
//#endregion
|
|
103
118
|
//#region ../webpack/src/plugins/ssr-styles.ts
|
|
104
119
|
const CSS_URL_RE = /url\((['"]?)(\/[^)]+?)\1\)/g;
|
|
105
120
|
const isVueFile = (id) => /\.vue(?:\?|$)/.test(id);
|
|
106
121
|
const isCSSLike = (name) => /\.(?:css|scss|sass|less|styl(?:us)?|postcss|pcss)(?:\?|$)/.test(name);
|
|
107
|
-
function normalizePath(nuxt
|
|
122
|
+
function normalizePath(nuxt, id) {
|
|
108
123
|
if (!id) return null;
|
|
109
|
-
const { pathname } =
|
|
110
|
-
const rel = relative(nuxt
|
|
124
|
+
const { pathname } = parseModuleId(id);
|
|
125
|
+
const rel = relative(nuxt.options.srcDir, pathname);
|
|
111
126
|
if (rel.startsWith("..")) return null;
|
|
112
127
|
return rel;
|
|
113
128
|
}
|
|
114
129
|
function resolveFilePath(id) {
|
|
115
130
|
if (!id) return null;
|
|
116
|
-
return
|
|
131
|
+
return parseModuleId(normalize(id)).pathname || null;
|
|
117
132
|
}
|
|
118
133
|
function sanitizeStyleAssetName(rel) {
|
|
119
134
|
return rel.replace(/[\\/]/g, "_").replace(/\.{2,}/g, "_");
|
|
@@ -127,12 +142,12 @@ function extractVueStyles(filePath) {
|
|
|
127
142
|
const styles = [];
|
|
128
143
|
const scopeId = createHash("sha256").update(filePath).digest("hex").slice(0, 8);
|
|
129
144
|
for (let i = 0; i < descriptor.styles.length; i++) {
|
|
130
|
-
const style
|
|
145
|
+
const style = descriptor.styles[i];
|
|
131
146
|
const result = compileStyle({
|
|
132
|
-
source: style
|
|
147
|
+
source: style.content,
|
|
133
148
|
filename: filePath,
|
|
134
149
|
id: `data-v-${scopeId}`,
|
|
135
|
-
scoped: style
|
|
150
|
+
scoped: style.scoped
|
|
136
151
|
});
|
|
137
152
|
if (!result.errors.length && result.code) styles.push(normalizeCSSContent(result.code));
|
|
138
153
|
}
|
|
@@ -146,10 +161,10 @@ var SSRStylesPlugin = class {
|
|
|
146
161
|
clientCSSByIssuer = /* @__PURE__ */ new Map();
|
|
147
162
|
chunksWithInlinedCSS = /* @__PURE__ */ new Set();
|
|
148
163
|
globalCSSPaths = /* @__PURE__ */ new Set();
|
|
149
|
-
constructor(nuxt
|
|
150
|
-
this.nuxt = nuxt
|
|
164
|
+
constructor(nuxt) {
|
|
165
|
+
this.nuxt = nuxt;
|
|
151
166
|
this.globalCSSPaths = this.resolveGlobalCSS();
|
|
152
|
-
nuxt
|
|
167
|
+
nuxt.hook("build:manifest", (manifest) => {
|
|
153
168
|
for (const [id, chunk] of Object.entries(manifest)) {
|
|
154
169
|
if (chunk.isEntry && chunk.src) this.chunksWithInlinedCSS.add(chunk.src);
|
|
155
170
|
else if (this.chunksWithInlinedCSS.has(id)) chunk.css &&= [];
|
|
@@ -175,9 +190,9 @@ var SSRStylesPlugin = class {
|
|
|
175
190
|
isPublicAsset(url, nitro) {
|
|
176
191
|
const cleaned = url.replace(/[?#].*$/, "");
|
|
177
192
|
for (const dir of nitro.options.publicAssets) {
|
|
178
|
-
const base
|
|
179
|
-
if (!url.startsWith(base
|
|
180
|
-
if (existsSync(cleaned.replace(base
|
|
193
|
+
const base = withTrailingSlash(dir.baseURL || "/");
|
|
194
|
+
if (!url.startsWith(base)) continue;
|
|
195
|
+
if (existsSync(cleaned.replace(base, withTrailingSlash(dir.dir)))) return true;
|
|
181
196
|
}
|
|
182
197
|
return false;
|
|
183
198
|
}
|
|
@@ -240,11 +255,6 @@ var SSRStylesPlugin = class {
|
|
|
240
255
|
}
|
|
241
256
|
return null;
|
|
242
257
|
}
|
|
243
|
-
normalizeResourcePath(resource) {
|
|
244
|
-
if (!resource) return null;
|
|
245
|
-
const withoutQuery = resource.split("?")[0];
|
|
246
|
-
return resolveFilePath(withoutQuery);
|
|
247
|
-
}
|
|
248
258
|
apply(compiler) {
|
|
249
259
|
if (this.nuxt.options.dev) return;
|
|
250
260
|
const isClient = compiler.options.name === "client";
|
|
@@ -257,8 +267,8 @@ var SSRStylesPlugin = class {
|
|
|
257
267
|
});
|
|
258
268
|
}
|
|
259
269
|
emitServerStyles(compilation) {
|
|
260
|
-
const { webpack
|
|
261
|
-
const stage = webpack
|
|
270
|
+
const { webpack } = compilation.compiler;
|
|
271
|
+
const stage = webpack.Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE;
|
|
262
272
|
compilation.hooks.processAssets.tap({
|
|
263
273
|
name: "SSRStylesPlugin",
|
|
264
274
|
stage
|
|
@@ -288,10 +298,10 @@ var SSRStylesPlugin = class {
|
|
|
288
298
|
if (vueStyles.length) collected.set(rel, new Set(vueStyles));
|
|
289
299
|
}
|
|
290
300
|
const emitted = {};
|
|
291
|
-
const rawSource = webpack
|
|
301
|
+
const rawSource = webpack.sources.RawSource;
|
|
292
302
|
for (const [rel, cssSet] of collected.entries()) {
|
|
293
303
|
if (!cssSet.size) continue;
|
|
294
|
-
const transformed = Array.from(cssSet).map((style
|
|
304
|
+
const transformed = Array.from(cssSet).map((style) => this.rewriteStyle(style, nitro));
|
|
295
305
|
const needsPublicAssets = transformed.some((t) => t.needsPublicAsset);
|
|
296
306
|
const needsBuildAssets = transformed.some((t) => t.needsBuildAsset);
|
|
297
307
|
const imports = [];
|
|
@@ -358,8 +368,8 @@ var SSRStylesPlugin = class {
|
|
|
358
368
|
});
|
|
359
369
|
}
|
|
360
370
|
collectCSS(compilation) {
|
|
361
|
-
const { webpack
|
|
362
|
-
const stage = compilation.compiler.options.name === "server" ? webpack
|
|
371
|
+
const { webpack } = compilation.compiler;
|
|
372
|
+
const stage = compilation.compiler.options.name === "server" ? webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS : webpack.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFER;
|
|
363
373
|
const chunkCSSMeta = /* @__PURE__ */ new Map();
|
|
364
374
|
compilation.hooks.processAssets.tap({
|
|
365
375
|
name: "SSRStylesPlugin",
|
|
@@ -418,7 +428,6 @@ var SSRStylesPlugin = class {
|
|
|
418
428
|
return cssChunks;
|
|
419
429
|
}
|
|
420
430
|
};
|
|
421
|
-
|
|
422
431
|
//#endregion
|
|
423
432
|
//#region ../webpack/src/utils/mfs.ts
|
|
424
433
|
function createMFS() {
|
|
@@ -428,24 +437,22 @@ function createMFS() {
|
|
|
428
437
|
_fs.readFile = pify(_fs.readFile);
|
|
429
438
|
return _fs;
|
|
430
439
|
}
|
|
431
|
-
|
|
432
440
|
//#endregion
|
|
433
441
|
//#region ../webpack/src/utils/index.ts
|
|
434
442
|
/** @since 3.9.0 */
|
|
435
443
|
function toArray(value) {
|
|
436
444
|
return Array.isArray(value) ? value : [value];
|
|
437
445
|
}
|
|
438
|
-
|
|
439
446
|
//#endregion
|
|
440
447
|
//#region ../webpack/src/utils/config.ts
|
|
441
|
-
function createWebpackConfigContext(nuxt
|
|
448
|
+
function createWebpackConfigContext(nuxt) {
|
|
442
449
|
return {
|
|
443
|
-
nuxt
|
|
444
|
-
options: nuxt
|
|
445
|
-
userConfig: nuxt
|
|
450
|
+
nuxt,
|
|
451
|
+
options: nuxt.options,
|
|
452
|
+
userConfig: nuxt.options.webpack,
|
|
446
453
|
config: {},
|
|
447
454
|
name: "base",
|
|
448
|
-
isDev: nuxt
|
|
455
|
+
isDev: nuxt.options.dev,
|
|
449
456
|
isServer: false,
|
|
450
457
|
isClient: false,
|
|
451
458
|
alias: {},
|
|
@@ -457,15 +464,14 @@ async function applyPresets(ctx, presets) {
|
|
|
457
464
|
else await preset(ctx);
|
|
458
465
|
}
|
|
459
466
|
function fileName(ctx, key) {
|
|
460
|
-
let fileName
|
|
461
|
-
if (typeof fileName
|
|
462
|
-
if (typeof fileName
|
|
463
|
-
const hash
|
|
464
|
-
if (hash
|
|
467
|
+
let fileName = ctx.userConfig.filenames[key];
|
|
468
|
+
if (typeof fileName === "function") fileName = fileName(ctx);
|
|
469
|
+
if (typeof fileName === "string" && ctx.options.dev) {
|
|
470
|
+
const hash = /\[(chunkhash|contenthash|hash)(?::\d+)?\]/.exec(fileName);
|
|
471
|
+
if (hash) logger.warn(`Notice: Please do not use ${hash[1]} in dev mode to prevent memory leak`);
|
|
465
472
|
}
|
|
466
|
-
return fileName
|
|
473
|
+
return fileName;
|
|
467
474
|
}
|
|
468
|
-
|
|
469
475
|
//#endregion
|
|
470
476
|
//#region ../webpack/src/presets/assets.ts
|
|
471
477
|
function assets(ctx) {
|
|
@@ -498,7 +504,6 @@ function assets(ctx) {
|
|
|
498
504
|
}]
|
|
499
505
|
});
|
|
500
506
|
}
|
|
501
|
-
|
|
502
507
|
//#endregion
|
|
503
508
|
//#region ../webpack/src/plugins/warning-ignore.ts
|
|
504
509
|
var WarningIgnorePlugin = class {
|
|
@@ -512,7 +517,6 @@ var WarningIgnorePlugin = class {
|
|
|
512
517
|
});
|
|
513
518
|
}
|
|
514
519
|
};
|
|
515
|
-
|
|
516
520
|
//#endregion
|
|
517
521
|
//#region ../webpack/src/plugins/vue/util.ts
|
|
518
522
|
/**
|
|
@@ -529,7 +533,6 @@ const extractQueryPartJS = (file) => isJSRegExp.exec(file)?.[1];
|
|
|
529
533
|
const isCSSRegExp = /\.css(?:\?[^.]+)?$/;
|
|
530
534
|
const isCSS = (file) => isCSSRegExp.test(file);
|
|
531
535
|
const isHotUpdate = (file) => file.includes("hot-update");
|
|
532
|
-
|
|
533
536
|
//#endregion
|
|
534
537
|
//#region ../webpack/src/plugins/rollup-compat-dynamic-import.ts
|
|
535
538
|
const DYNAMIC_IMPORT_RE = /import\([^)]*\+\s*__webpack_require__[^+]*\)\.then/;
|
|
@@ -547,18 +550,18 @@ var RollupCompatDynamicImportPlugin = class {
|
|
|
547
550
|
compilation.hooks.processAssets.tapAsync({
|
|
548
551
|
name: "RollupCompatDynamicImportPlugin",
|
|
549
552
|
stage: compiler.webpack.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_INLINE
|
|
550
|
-
}, (assets
|
|
553
|
+
}, (assets, callback) => {
|
|
551
554
|
try {
|
|
552
555
|
const targetFiles = /* @__PURE__ */ new Set();
|
|
553
556
|
for (const chunk of compilation.chunks) if (chunk.canBeInitial() || chunk.hasRuntime()) for (const file of chunk.files || []) targetFiles.add(file);
|
|
554
|
-
for (const [filename, asset] of Object.entries(assets
|
|
557
|
+
for (const [filename, asset] of Object.entries(assets)) {
|
|
555
558
|
if (!isJS(filename)) continue;
|
|
556
559
|
if (!targetFiles.has(filename)) continue;
|
|
557
560
|
const source = asset.source();
|
|
558
561
|
const originalCode = typeof source === "string" ? source : source.toString();
|
|
559
562
|
if (!DYNAMIC_IMPORT_RE.test(originalCode)) continue;
|
|
560
563
|
const transformedCode = this.transformDynamicImports(originalCode);
|
|
561
|
-
if (transformedCode !== originalCode) assets
|
|
564
|
+
if (transformedCode !== originalCode) assets[filename] = new compiler.webpack.sources.RawSource(transformedCode);
|
|
562
565
|
}
|
|
563
566
|
this.generateDynamicImportHelper(compilation);
|
|
564
567
|
callback();
|
|
@@ -608,7 +611,6 @@ export function _rollupDynamicImport(chunkId) {
|
|
|
608
611
|
`;
|
|
609
612
|
}
|
|
610
613
|
};
|
|
611
|
-
|
|
612
614
|
//#endregion
|
|
613
615
|
//#region ../webpack/src/presets/base.ts
|
|
614
616
|
async function base(ctx) {
|
|
@@ -786,7 +788,6 @@ const statsMap = {
|
|
|
786
788
|
info: "normal",
|
|
787
789
|
verbose: "verbose"
|
|
788
790
|
};
|
|
789
|
-
|
|
790
791
|
//#endregion
|
|
791
792
|
//#region ../webpack/src/presets/esbuild.ts
|
|
792
793
|
function esbuild(ctx) {
|
|
@@ -816,7 +817,6 @@ function esbuild(ctx) {
|
|
|
816
817
|
}
|
|
817
818
|
});
|
|
818
819
|
}
|
|
819
|
-
|
|
820
820
|
//#endregion
|
|
821
821
|
//#region ../webpack/src/presets/pug.ts
|
|
822
822
|
function pug(ctx) {
|
|
@@ -834,7 +834,6 @@ function pug(ctx) {
|
|
|
834
834
|
}] }]
|
|
835
835
|
});
|
|
836
836
|
}
|
|
837
|
-
|
|
838
837
|
//#endregion
|
|
839
838
|
//#region ../webpack/src/utils/postcss.ts
|
|
840
839
|
const isPureObject = (obj) => obj !== null && !Array.isArray(obj) && typeof obj === "object";
|
|
@@ -842,27 +841,27 @@ function sortPlugins({ plugins, order }) {
|
|
|
842
841
|
const names = Object.keys(plugins);
|
|
843
842
|
return typeof order === "function" ? order(names) : order || names;
|
|
844
843
|
}
|
|
845
|
-
async function getPostcssConfig(nuxt
|
|
846
|
-
if (!nuxt
|
|
847
|
-
const postcssOptions = defu({}, nuxt
|
|
844
|
+
async function getPostcssConfig(nuxt) {
|
|
845
|
+
if (!nuxt.options.webpack.postcss || !nuxt.options.postcss) return false;
|
|
846
|
+
const postcssOptions = defu({}, nuxt.options.postcss, {
|
|
848
847
|
plugins: {
|
|
849
848
|
"postcss-import": { resolve: createResolver({
|
|
850
|
-
alias: { ...nuxt
|
|
851
|
-
modules: nuxt
|
|
849
|
+
alias: { ...nuxt.options.alias },
|
|
850
|
+
modules: nuxt.options.modulesDir
|
|
852
851
|
}) },
|
|
853
852
|
"postcss-url": {}
|
|
854
853
|
},
|
|
855
|
-
sourceMap: nuxt
|
|
854
|
+
sourceMap: nuxt.options.webpack.cssSourceMap
|
|
856
855
|
});
|
|
857
|
-
const jiti = createJiti(nuxt
|
|
856
|
+
const jiti = createJiti(nuxt.options.rootDir, { alias: nuxt.options.alias });
|
|
858
857
|
if (!Array.isArray(postcssOptions.plugins) && isPureObject(postcssOptions.plugins)) {
|
|
859
858
|
const plugins = [];
|
|
860
|
-
for (const pluginName
|
|
861
|
-
const pluginOptions = postcssOptions.plugins[pluginName
|
|
859
|
+
for (const pluginName of sortPlugins(postcssOptions)) {
|
|
860
|
+
const pluginOptions = postcssOptions.plugins[pluginName];
|
|
862
861
|
if (!pluginOptions) continue;
|
|
863
862
|
let pluginFn;
|
|
864
|
-
for (const parentURL of nuxt
|
|
865
|
-
pluginFn = await jiti.import(pluginName
|
|
863
|
+
for (const parentURL of nuxt.options.modulesDir) {
|
|
864
|
+
pluginFn = await jiti.import(pluginName, {
|
|
866
865
|
parentURL: parentURL.replace(/\/node_modules\/?$/, ""),
|
|
867
866
|
try: true,
|
|
868
867
|
default: true
|
|
@@ -872,17 +871,16 @@ async function getPostcssConfig(nuxt$1) {
|
|
|
872
871
|
break;
|
|
873
872
|
}
|
|
874
873
|
}
|
|
875
|
-
if (typeof pluginFn !== "function") console.warn(`[nuxt] could not import postcss plugin \`${pluginName
|
|
874
|
+
if (typeof pluginFn !== "function") console.warn(`[nuxt] could not import postcss plugin \`${pluginName}\`. Please report this as a bug.`);
|
|
876
875
|
}
|
|
877
876
|
postcssOptions.plugins = plugins;
|
|
878
877
|
}
|
|
879
878
|
return {
|
|
880
|
-
sourceMap: nuxt
|
|
881
|
-
...nuxt
|
|
879
|
+
sourceMap: nuxt.options.webpack.cssSourceMap,
|
|
880
|
+
...nuxt.options.webpack.postcss,
|
|
882
881
|
postcssOptions
|
|
883
882
|
};
|
|
884
883
|
}
|
|
885
|
-
|
|
886
884
|
//#endregion
|
|
887
885
|
//#region ../webpack/src/presets/style.ts
|
|
888
886
|
async function style(ctx) {
|
|
@@ -964,7 +962,6 @@ async function createPostcssLoadersRule(ctx) {
|
|
|
964
962
|
options: config
|
|
965
963
|
};
|
|
966
964
|
}
|
|
967
|
-
|
|
968
965
|
//#endregion
|
|
969
966
|
//#region ../webpack/src/plugins/vue/client.ts
|
|
970
967
|
/**
|
|
@@ -988,9 +985,9 @@ var VueSSRClientPlugin = class {
|
|
|
988
985
|
const stats = compilation.getStats().toJson();
|
|
989
986
|
const context = this.nuxt.options.srcDir;
|
|
990
987
|
const initialFiles = /* @__PURE__ */ new Set();
|
|
991
|
-
for (const { assets
|
|
992
|
-
if (!assets
|
|
993
|
-
for (const asset of assets
|
|
988
|
+
for (const { assets } of Object.values(stats.entrypoints)) {
|
|
989
|
+
if (!assets) continue;
|
|
990
|
+
for (const asset of assets) {
|
|
994
991
|
const file = asset.name;
|
|
995
992
|
if ((isJS(file) || isCSS(file)) && !isHotUpdate(file)) initialFiles.add(file);
|
|
996
993
|
}
|
|
@@ -1036,11 +1033,11 @@ var VueSSRClientPlugin = class {
|
|
|
1036
1033
|
const files = Array.from(filesSet);
|
|
1037
1034
|
webpackManifest.modules[relativeId] = files;
|
|
1038
1035
|
if (Array.isArray(m.modules)) for (const concatenatedModule of m.modules) {
|
|
1039
|
-
const relativeId
|
|
1040
|
-
webpackManifest.modules[relativeId
|
|
1036
|
+
const relativeId = this.getRelativeModuleId(concatenatedModule.identifier, context);
|
|
1037
|
+
webpackManifest.modules[relativeId] ||= files;
|
|
1041
1038
|
}
|
|
1042
1039
|
if (stats.modules) {
|
|
1043
|
-
for (const m
|
|
1040
|
+
for (const m of stats.modules) if (m.assets?.length && m.chunks?.includes(cid)) files.push(...m.assets.map(fileToIndex));
|
|
1044
1041
|
}
|
|
1045
1042
|
}
|
|
1046
1043
|
const manifest = normalizeWebpackManifest(webpackManifest);
|
|
@@ -1053,7 +1050,6 @@ var VueSSRClientPlugin = class {
|
|
|
1053
1050
|
});
|
|
1054
1051
|
}
|
|
1055
1052
|
};
|
|
1056
|
-
|
|
1057
1053
|
//#endregion
|
|
1058
1054
|
//#region ../webpack/src/plugins/vue/server.ts
|
|
1059
1055
|
const JS_MAP_RE = /\.js\.map$/;
|
|
@@ -1068,7 +1064,7 @@ var VueSSRServerPlugin = class {
|
|
|
1068
1064
|
compilation.hooks.processAssets.tapAsync({
|
|
1069
1065
|
name: "VueSSRServerPlugin",
|
|
1070
1066
|
stage: webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL
|
|
1071
|
-
}, (assets
|
|
1067
|
+
}, (assets, cb) => {
|
|
1072
1068
|
const stats = compilation.getStats().toJson();
|
|
1073
1069
|
const [entryName] = Object.keys(stats.entrypoints);
|
|
1074
1070
|
const entryInfo = stats.entrypoints[entryName];
|
|
@@ -1077,24 +1073,24 @@ var VueSSRServerPlugin = class {
|
|
|
1077
1073
|
if (entryAssets.length > 1) throw new Error("Server-side bundle should have one single entry file. Avoid using CommonsChunkPlugin in the server config.");
|
|
1078
1074
|
const [entry] = entryAssets;
|
|
1079
1075
|
if (!entry || typeof entry.name !== "string") throw new Error(`Entry "${entryName}" not found. Did you specify the correct entry option?`);
|
|
1080
|
-
const bundle
|
|
1076
|
+
const bundle = {
|
|
1081
1077
|
entry: entry.name,
|
|
1082
1078
|
files: {},
|
|
1083
1079
|
maps: {}
|
|
1084
1080
|
};
|
|
1085
1081
|
for (const asset of stats.assets) if (isJS(asset.name)) {
|
|
1086
1082
|
const queryPart = extractQueryPartJS(asset.name);
|
|
1087
|
-
if (queryPart !== void 0) bundle
|
|
1088
|
-
else bundle
|
|
1089
|
-
} else if (JS_MAP_RE.test(asset.name)) bundle
|
|
1090
|
-
else delete assets
|
|
1091
|
-
const src = JSON.stringify(bundle
|
|
1092
|
-
assets
|
|
1083
|
+
if (queryPart !== void 0) bundle.files[asset.name] = asset.name.replace(queryPart, "");
|
|
1084
|
+
else bundle.files[asset.name] = asset.name;
|
|
1085
|
+
} else if (JS_MAP_RE.test(asset.name)) bundle.maps[asset.name.replace(/\.map$/, "")] = asset.name;
|
|
1086
|
+
else delete assets[asset.name];
|
|
1087
|
+
const src = JSON.stringify(bundle, null, 2);
|
|
1088
|
+
assets[this.options.filename] = {
|
|
1093
1089
|
source: () => src,
|
|
1094
1090
|
size: () => src.length
|
|
1095
1091
|
};
|
|
1096
1092
|
const mjsSrc = "export default " + src;
|
|
1097
|
-
assets
|
|
1093
|
+
assets[this.options.filename.replace(".json", ".mjs")] = {
|
|
1098
1094
|
source: () => mjsSrc,
|
|
1099
1095
|
map: () => null,
|
|
1100
1096
|
size: () => mjsSrc.length
|
|
@@ -1104,11 +1100,14 @@ var VueSSRServerPlugin = class {
|
|
|
1104
1100
|
});
|
|
1105
1101
|
}
|
|
1106
1102
|
};
|
|
1107
|
-
|
|
1108
1103
|
//#endregion
|
|
1109
1104
|
//#region ../webpack/src/presets/vue.ts
|
|
1110
1105
|
function vue(ctx) {
|
|
1111
|
-
ctx.
|
|
1106
|
+
ctx.nuxt.hooks.hookOnce(`${builder}:config`, () => {
|
|
1107
|
+
ctx.nuxt.hook(`${builder}:configResolved`, (configs) => {
|
|
1108
|
+
for (const config of configs) config.plugins.unshift(new (VueLoaderPlugin.default || VueLoaderPlugin)());
|
|
1109
|
+
});
|
|
1110
|
+
});
|
|
1112
1111
|
ctx.config.module.rules.push({
|
|
1113
1112
|
test: /\.vue$/i,
|
|
1114
1113
|
loader: "vue-loader",
|
|
@@ -1136,7 +1135,6 @@ function vue(ctx) {
|
|
|
1136
1135
|
"__VUE_PROD_HYDRATION_MISMATCH_DETAILS__": ctx.nuxt.options.debug && ctx.nuxt.options.debug.hydration
|
|
1137
1136
|
}));
|
|
1138
1137
|
}
|
|
1139
|
-
|
|
1140
1138
|
//#endregion
|
|
1141
1139
|
//#region ../webpack/src/presets/nuxt.ts
|
|
1142
1140
|
async function nuxt(ctx) {
|
|
@@ -1149,7 +1147,6 @@ async function nuxt(ctx) {
|
|
|
1149
1147
|
vue
|
|
1150
1148
|
]);
|
|
1151
1149
|
}
|
|
1152
|
-
|
|
1153
1150
|
//#endregion
|
|
1154
1151
|
//#region ../webpack/src/configs/client.ts
|
|
1155
1152
|
async function client(ctx) {
|
|
@@ -1257,7 +1254,6 @@ function clientPlugins(ctx) {
|
|
|
1257
1254
|
if (!ctx.nuxt.options.test && (ctx.nuxt.options.typescript.typeCheck === true || ctx.nuxt.options.typescript.typeCheck === "build" && !ctx.nuxt.options.dev)) ctx.config.plugins.push(new TsCheckerPlugin({ logger }));
|
|
1258
1255
|
}
|
|
1259
1256
|
}
|
|
1260
|
-
|
|
1261
1257
|
//#endregion
|
|
1262
1258
|
//#region ../webpack/src/presets/node.ts
|
|
1263
1259
|
function node(ctx) {
|
|
@@ -1288,7 +1284,6 @@ function node(ctx) {
|
|
|
1288
1284
|
maxAssetSize: Number.POSITIVE_INFINITY
|
|
1289
1285
|
};
|
|
1290
1286
|
}
|
|
1291
|
-
|
|
1292
1287
|
//#endregion
|
|
1293
1288
|
//#region ../webpack/src/configs/server.ts
|
|
1294
1289
|
const assetPattern = /\.(?:css|s[ca]ss|png|jpe?g|gif|svg|woff2?|eot|ttf|otf|webp|webm|mp4|ogv)(?:\?.*)?$/i;
|
|
@@ -1383,117 +1378,116 @@ function serverPlugins(ctx) {
|
|
|
1383
1378
|
}));
|
|
1384
1379
|
if (!ctx.nuxt.options.test && (ctx.nuxt.options.typescript.typeCheck === true || ctx.nuxt.options.typescript.typeCheck === "build" && !ctx.nuxt.options.dev)) ctx.config.plugins.push(new TsCheckerPlugin({ logger }));
|
|
1385
1380
|
}
|
|
1386
|
-
|
|
1387
1381
|
//#endregion
|
|
1388
1382
|
//#region ../webpack/src/webpack.ts
|
|
1389
|
-
const bundle = async (nuxt
|
|
1390
|
-
const webpackConfigs = await Promise.all([client, ...nuxt
|
|
1391
|
-
const ctx = createWebpackConfigContext(nuxt
|
|
1392
|
-
ctx.userConfig = defu(nuxt
|
|
1383
|
+
const bundle = async (nuxt) => {
|
|
1384
|
+
const webpackConfigs = await Promise.all([client, ...nuxt.options.ssr ? [server] : []].map(async (preset) => {
|
|
1385
|
+
const ctx = createWebpackConfigContext(nuxt);
|
|
1386
|
+
ctx.userConfig = defu(nuxt.options.webpack[`$${preset.name}`], ctx.userConfig);
|
|
1393
1387
|
await applyPresets(ctx, preset);
|
|
1394
1388
|
return ctx.config;
|
|
1395
1389
|
}));
|
|
1396
1390
|
/** Remove Nitro rollup plugin for handling dynamic imports from webpack chunks */
|
|
1397
|
-
if (!nuxt
|
|
1391
|
+
if (!nuxt.options.dev) useNitro().hooks.hook("rollup:before", (_nitro, config) => {
|
|
1398
1392
|
const plugins = config.plugins;
|
|
1399
1393
|
const existingPlugin = plugins.findIndex((i) => i && "name" in i && i.name === "dynamic-require");
|
|
1400
1394
|
if (existingPlugin >= 0) plugins.splice(existingPlugin, 1);
|
|
1401
1395
|
});
|
|
1402
|
-
await nuxt
|
|
1403
|
-
const mfs = nuxt
|
|
1404
|
-
const ssrStylesPlugin = nuxt
|
|
1396
|
+
await nuxt.callHook(`${builder}:config`, webpackConfigs);
|
|
1397
|
+
const mfs = nuxt.options.dev ? createMFS() : null;
|
|
1398
|
+
const ssrStylesPlugin = nuxt.options.ssr && !nuxt.options.dev && nuxt.options.features.inlineStyles ? new SSRStylesPlugin(nuxt) : null;
|
|
1405
1399
|
for (const config of webpackConfigs) {
|
|
1406
|
-
config.plugins.push(DynamicBasePlugin.webpack({ sourcemap: !!nuxt
|
|
1407
|
-
if (config.name === "client" && nuxt
|
|
1400
|
+
config.plugins.push(DynamicBasePlugin.webpack({ sourcemap: !!nuxt.options.sourcemap[config.name] }));
|
|
1401
|
+
if (config.name === "client" && nuxt.options.experimental.emitRouteChunkError && nuxt.options.builder !== "@nuxt/rspack-builder") config.plugins.push(new ChunkErrorPlugin());
|
|
1408
1402
|
if (ssrStylesPlugin) config.plugins.push(ssrStylesPlugin);
|
|
1409
1403
|
}
|
|
1410
|
-
await nuxt
|
|
1404
|
+
await nuxt.callHook(`${builder}:configResolved`, webpackConfigs);
|
|
1411
1405
|
const compilers = webpackConfigs.map((config) => {
|
|
1412
1406
|
const compiler = webpack(config);
|
|
1413
|
-
if (nuxt
|
|
1407
|
+
if (nuxt.options.dev && compiler) compiler.outputFileSystem = mfs;
|
|
1414
1408
|
return compiler;
|
|
1415
1409
|
});
|
|
1416
|
-
nuxt
|
|
1417
|
-
for (const compiler of compilers) await new Promise((resolve
|
|
1410
|
+
nuxt.hook("close", async () => {
|
|
1411
|
+
for (const compiler of compilers) await new Promise((resolve) => compiler.close(resolve));
|
|
1418
1412
|
});
|
|
1419
|
-
if (nuxt
|
|
1413
|
+
if (nuxt.options.dev) {
|
|
1420
1414
|
await Promise.all(compilers.map((c) => compile(c)));
|
|
1421
1415
|
return;
|
|
1422
1416
|
}
|
|
1423
1417
|
for (const c of compilers) await compile(c);
|
|
1424
1418
|
};
|
|
1425
1419
|
async function createDevMiddleware(compiler) {
|
|
1426
|
-
const nuxt
|
|
1420
|
+
const nuxt = useNuxt();
|
|
1427
1421
|
logger.debug("Creating webpack middleware...");
|
|
1428
1422
|
const devMiddleware = webpackDevMiddleware(compiler, {
|
|
1429
|
-
publicPath: joinURL(nuxt
|
|
1423
|
+
publicPath: joinURL(nuxt.options.app.baseURL, nuxt.options.app.buildAssetsDir),
|
|
1430
1424
|
outputFileSystem: compiler.outputFileSystem,
|
|
1431
1425
|
stats: "none",
|
|
1432
|
-
...nuxt
|
|
1426
|
+
...nuxt.options.webpack.devMiddleware
|
|
1433
1427
|
});
|
|
1434
|
-
nuxt
|
|
1435
|
-
const { client: _client, ...hotMiddlewareOptions } = nuxt
|
|
1428
|
+
nuxt.hook("close", () => pify(devMiddleware.close.bind(devMiddleware))());
|
|
1429
|
+
const { client: _client, ...hotMiddlewareOptions } = nuxt.options.webpack.hotMiddleware || {};
|
|
1436
1430
|
const hotMiddleware = webpackHotMiddleware(compiler, {
|
|
1437
1431
|
log: false,
|
|
1438
1432
|
heartbeat: 1e4,
|
|
1439
|
-
path: joinURL(nuxt
|
|
1433
|
+
path: joinURL(nuxt.options.app.baseURL, "__webpack_hmr", compiler.options.name),
|
|
1440
1434
|
...hotMiddlewareOptions
|
|
1441
1435
|
});
|
|
1442
1436
|
const devHandler = wdmToH3Handler(devMiddleware);
|
|
1443
|
-
await nuxt
|
|
1437
|
+
await nuxt.callHook("server:devHandler", defineEventHandler(async (event) => {
|
|
1444
1438
|
const body = await devHandler(event);
|
|
1445
1439
|
if (body !== void 0) return body;
|
|
1446
1440
|
const { req, res } = "runtime" in event ? event.runtime.node : event.node;
|
|
1447
|
-
await new Promise((resolve
|
|
1441
|
+
await new Promise((resolve, reject) => hotMiddleware(req, res, (err) => err ? reject(err) : resolve()));
|
|
1448
1442
|
}), { cors: () => true });
|
|
1449
1443
|
return devMiddleware;
|
|
1450
1444
|
}
|
|
1451
1445
|
function wdmToH3Handler(devMiddleware) {
|
|
1452
1446
|
return defineEventHandler(async (event) => {
|
|
1453
1447
|
const { req, res } = "runtime" in event ? event.runtime.node : event.node;
|
|
1454
|
-
if (req.headers["sec-fetch-mode"] === "no-cors" && req.headers["sec-fetch-site"] === "cross-site")
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
}
|
|
1459
|
-
return await new Promise((resolve
|
|
1448
|
+
if (req.headers["sec-fetch-mode"] === "no-cors" && req.headers["sec-fetch-site"] === "cross-site") {
|
|
1449
|
+
res.statusCode = 403;
|
|
1450
|
+
res.end("Forbidden");
|
|
1451
|
+
return;
|
|
1452
|
+
}
|
|
1453
|
+
return await new Promise((resolve, reject) => {
|
|
1460
1454
|
res.stream = (stream) => {
|
|
1461
|
-
resolve
|
|
1455
|
+
resolve(stream);
|
|
1462
1456
|
};
|
|
1463
1457
|
res.send = (data) => {
|
|
1464
|
-
resolve
|
|
1458
|
+
resolve(data);
|
|
1465
1459
|
};
|
|
1466
1460
|
res.finish = (data) => {
|
|
1467
|
-
resolve
|
|
1461
|
+
resolve(data);
|
|
1468
1462
|
};
|
|
1469
1463
|
devMiddleware(req, res, (err) => {
|
|
1470
1464
|
if (err) reject(err);
|
|
1471
|
-
else resolve
|
|
1465
|
+
else resolve(void 0);
|
|
1472
1466
|
});
|
|
1473
1467
|
});
|
|
1474
1468
|
});
|
|
1475
1469
|
}
|
|
1476
1470
|
async function compile(compiler) {
|
|
1477
|
-
const nuxt
|
|
1478
|
-
await nuxt
|
|
1471
|
+
const nuxt = useNuxt();
|
|
1472
|
+
await nuxt.callHook(`${builder}:compile`, {
|
|
1479
1473
|
name: compiler.options.name,
|
|
1480
1474
|
compiler
|
|
1481
1475
|
});
|
|
1482
|
-
compiler.hooks.done.tap("load-resources", async (stats
|
|
1483
|
-
await nuxt
|
|
1476
|
+
compiler.hooks.done.tap("load-resources", async (stats) => {
|
|
1477
|
+
await nuxt.callHook(`${builder}:compiled`, {
|
|
1484
1478
|
name: compiler.options.name,
|
|
1485
1479
|
compiler,
|
|
1486
|
-
stats
|
|
1480
|
+
stats
|
|
1487
1481
|
});
|
|
1488
1482
|
});
|
|
1489
|
-
if (nuxt
|
|
1483
|
+
if (nuxt.options.dev) {
|
|
1490
1484
|
const compilersWatching = [];
|
|
1491
|
-
nuxt
|
|
1485
|
+
nuxt.hook("close", async () => {
|
|
1492
1486
|
await Promise.all(compilersWatching.map((watching) => watching && pify(watching.close.bind(watching))()));
|
|
1493
1487
|
});
|
|
1494
|
-
if (compiler.options.name === "client") return new Promise((resolve
|
|
1488
|
+
if (compiler.options.name === "client") return new Promise((resolve, reject) => {
|
|
1495
1489
|
compiler.hooks.done.tap("nuxt-dev", () => {
|
|
1496
|
-
resolve
|
|
1490
|
+
resolve(null);
|
|
1497
1491
|
});
|
|
1498
1492
|
compiler.hooks.failed.tap("nuxt-errorlog", (err) => {
|
|
1499
1493
|
reject(err);
|
|
@@ -1502,15 +1496,15 @@ async function compile(compiler) {
|
|
|
1502
1496
|
if (devMiddleware.context.watching) compilersWatching.push(devMiddleware.context.watching);
|
|
1503
1497
|
});
|
|
1504
1498
|
});
|
|
1505
|
-
return new Promise((resolve
|
|
1506
|
-
const watching = compiler.watch(nuxt
|
|
1499
|
+
return new Promise((resolve, reject) => {
|
|
1500
|
+
const watching = compiler.watch(nuxt.options.watchers.webpack, (err) => {
|
|
1507
1501
|
if (err) return reject(err);
|
|
1508
|
-
resolve
|
|
1502
|
+
resolve(null);
|
|
1509
1503
|
});
|
|
1510
1504
|
compilersWatching.push(watching);
|
|
1511
1505
|
});
|
|
1512
1506
|
}
|
|
1513
|
-
const stats = await new Promise((resolve
|
|
1507
|
+
const stats = await new Promise((resolve, reject) => compiler.run((err, stats) => err ? reject(err) : resolve(stats)));
|
|
1514
1508
|
if (stats.hasErrors()) {
|
|
1515
1509
|
const error = /* @__PURE__ */ new Error("Nuxt build error");
|
|
1516
1510
|
error.stack = stats.toString("errors-only");
|
|
@@ -1520,6 +1514,5 @@ async function compile(compiler) {
|
|
|
1520
1514
|
function defineEventHandler(handler) {
|
|
1521
1515
|
return Object.assign(handler, { __is_handler__: true });
|
|
1522
1516
|
}
|
|
1523
|
-
|
|
1524
1517
|
//#endregion
|
|
1525
|
-
export { bundle };
|
|
1518
|
+
export { bundle };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { normalize, relative } from "pathe";
|
|
2
|
-
|
|
3
2
|
//#region ../webpack/src/loaders/vue-module-identifier.ts
|
|
4
3
|
const vueModuleIdentifierLoader = function(source) {
|
|
5
4
|
this.cacheable?.();
|
|
@@ -10,7 +9,5 @@ const vueModuleIdentifierLoader = function(source) {
|
|
|
10
9
|
const moduleId = normalize(context ? relative(context, resourcePath) : resourcePath).replace(/^\.\//, "").replace(/\\/g, "/");
|
|
11
10
|
return source + `\n;__exports__.__moduleIdentifier = ${JSON.stringify(moduleId)};`;
|
|
12
11
|
};
|
|
13
|
-
var vue_module_identifier_default = vueModuleIdentifierLoader;
|
|
14
|
-
|
|
15
12
|
//#endregion
|
|
16
|
-
export {
|
|
13
|
+
export { vueModuleIdentifierLoader as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxt/rspack-builder",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/nuxt/nuxt.git",
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@nuxt/friendly-errors-webpack-plugin": "^2.6.0",
|
|
28
|
-
"@rspack/core": "^1.7.
|
|
29
|
-
"@vue/compiler-sfc": "3.5.
|
|
30
|
-
"autoprefixer": "^10.4.
|
|
31
|
-
"css-loader": "^7.1.
|
|
32
|
-
"css-minimizer-webpack-plugin": "^
|
|
33
|
-
"cssnano": "^7.1.
|
|
28
|
+
"@rspack/core": "^1.7.8",
|
|
29
|
+
"@vue/compiler-sfc": "3.5.30",
|
|
30
|
+
"autoprefixer": "^10.4.27",
|
|
31
|
+
"css-loader": "^7.1.4",
|
|
32
|
+
"css-minimizer-webpack-plugin": "^8.0.0",
|
|
33
|
+
"cssnano": "^7.1.3",
|
|
34
34
|
"defu": "^6.1.4",
|
|
35
35
|
"esbuild-loader": "^4.4.2",
|
|
36
36
|
"escape-string-regexp": "^5.0.0",
|
|
@@ -39,50 +39,50 @@
|
|
|
39
39
|
"jiti": "^2.6.1",
|
|
40
40
|
"knitwork": "^1.3.0",
|
|
41
41
|
"magic-string": "^0.30.21",
|
|
42
|
-
"memfs": "^4.56.
|
|
43
|
-
"mlly": "^1.8.
|
|
42
|
+
"memfs": "^4.56.11",
|
|
43
|
+
"mlly": "^1.8.1",
|
|
44
44
|
"ohash": "^2.0.11",
|
|
45
45
|
"pathe": "^2.0.3",
|
|
46
46
|
"pify": "^6.1.0",
|
|
47
|
-
"postcss": "^8.5.
|
|
47
|
+
"postcss": "^8.5.8",
|
|
48
48
|
"postcss-import": "^16.1.1",
|
|
49
49
|
"postcss-import-resolver": "^2.0.0",
|
|
50
|
-
"postcss-loader": "^8.2.
|
|
50
|
+
"postcss-loader": "^8.2.1",
|
|
51
51
|
"postcss-url": "^10.1.3",
|
|
52
52
|
"pug-plain-loader": "^1.1.0",
|
|
53
|
-
"seroval": "^1.
|
|
54
|
-
"std-env": "^
|
|
53
|
+
"seroval": "^1.5.1",
|
|
54
|
+
"std-env": "^4.0.0",
|
|
55
55
|
"time-fix-plugin": "^2.0.7",
|
|
56
56
|
"tinyglobby": "^0.2.15",
|
|
57
|
-
"ts-checker-rspack-plugin": "^1.
|
|
57
|
+
"ts-checker-rspack-plugin": "^1.3.0",
|
|
58
58
|
"ufo": "^1.6.3",
|
|
59
59
|
"unenv": "^2.0.0-rc.24",
|
|
60
|
-
"unplugin": "^
|
|
60
|
+
"unplugin": "^3.0.0",
|
|
61
61
|
"url-loader": "^4.1.1",
|
|
62
62
|
"vue-bundle-renderer": "^2.2.0",
|
|
63
63
|
"vue-loader": "^17.4.2",
|
|
64
|
-
"webpack-bundle-analyzer": "^5.
|
|
64
|
+
"webpack-bundle-analyzer": "^5.2.0",
|
|
65
65
|
"webpack-dev-middleware": "^7.4.5",
|
|
66
66
|
"webpack-hot-middleware": "^2.26.1",
|
|
67
67
|
"webpackbar": "^7.0.0",
|
|
68
|
-
"@nuxt/kit": "4.
|
|
68
|
+
"@nuxt/kit": "4.4.2"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@types/webpack-bundle-analyzer": "4.7.0",
|
|
72
72
|
"@types/webpack-hot-middleware": "2.25.12",
|
|
73
|
-
"h3": "1.15.
|
|
74
|
-
"h3-next": "npm:h3@2.0.1-rc.
|
|
75
|
-
"obuild": "0.4.
|
|
76
|
-
"rollup": "4.
|
|
77
|
-
"vue": "3.5.
|
|
78
|
-
"@nuxt/schema": "4.
|
|
73
|
+
"h3": "1.15.6",
|
|
74
|
+
"h3-next": "npm:h3@2.0.1-rc.16",
|
|
75
|
+
"obuild": "0.4.32",
|
|
76
|
+
"rollup": "4.59.0",
|
|
77
|
+
"vue": "3.5.30",
|
|
78
|
+
"@nuxt/schema": "4.4.2"
|
|
79
79
|
},
|
|
80
80
|
"peerDependencies": {
|
|
81
81
|
"vue": "^3.3.4",
|
|
82
|
-
"nuxt": "4.
|
|
82
|
+
"nuxt": "4.4.2"
|
|
83
83
|
},
|
|
84
84
|
"engines": {
|
|
85
|
-
"node": "^20.
|
|
85
|
+
"node": "^20.19.0 || >=22.12.0"
|
|
86
86
|
},
|
|
87
87
|
"scripts": {
|
|
88
88
|
"build:stub": "obuild --stub",
|