@nuxt/vite-builder-nightly 4.3.0-29356103.2f7957ac → 4.3.0-29430616.754c35a4
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 +8 -8
- package/dist/index.mjs +120 -61
- package/dist/runtime/vite-node-shared.mjs +1 -0
- package/dist/runtime/vite-node.mjs +1 -0
- package/package.json +22 -21
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>
|
|
@@ -14,13 +14,13 @@
|
|
|
14
14
|
Nuxt is a free and open-source framework with an intuitive and extendable way to create type-safe, performant and production-grade full-stack web applications and websites with Vue.js.
|
|
15
15
|
|
|
16
16
|
It provides a number of features that make it easy to build fast, SEO-friendly, and scalable web applications, including:
|
|
17
|
-
- Server-side rendering,
|
|
17
|
+
- Server-side rendering, static site generation, hybrid rendering and edge-side rendering
|
|
18
18
|
- Automatic routing with code-splitting and pre-fetching
|
|
19
19
|
- Data fetching and state management
|
|
20
|
-
-
|
|
20
|
+
- Search engine optimization and defining meta tags
|
|
21
21
|
- Auto imports of components, composables and utils
|
|
22
22
|
- TypeScript with zero configuration
|
|
23
|
-
- Go
|
|
23
|
+
- Go full-stack with our server/ directory
|
|
24
24
|
- Extensible with [200+ modules](https://nuxt.com/modules)
|
|
25
25
|
- Deployment to a variety of [hosting platforms](https://nuxt.com/deploy)
|
|
26
26
|
- ...[and much more](https://nuxt.com) 🚀
|
|
@@ -31,7 +31,7 @@ It provides a number of features that make it easy to build fast, SEO-friendly,
|
|
|
31
31
|
- 💻 [ Vue Development](#vue-development)
|
|
32
32
|
- 📖 [Documentation](#documentation)
|
|
33
33
|
- 🧩 [Modules](#modules)
|
|
34
|
-
- ❤️
|
|
34
|
+
- ❤️ [Contribute](#contribute)
|
|
35
35
|
- 🏠 [Local Development](#local-development)
|
|
36
36
|
- 🛟 [Professional Support](#professional-support)
|
|
37
37
|
- 🔗 [Follow Us](#follow-us)
|
|
@@ -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
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import fs, { existsSync, readFileSync } from 'node:fs';
|
|
2
|
+
import { performance } from 'node:perf_hooks';
|
|
2
3
|
import * as vite from 'vite';
|
|
3
4
|
import { isCSSRequest, createLogger, mergeConfig, createBuilder, createServer } from 'vite';
|
|
4
5
|
import { dirname, normalize, join, resolve, relative, basename, isAbsolute } from 'pathe';
|
|
@@ -11,11 +12,12 @@ import { filename as filename$1 } from 'pathe/utils';
|
|
|
11
12
|
import { resolveModulePath } from 'exsolve';
|
|
12
13
|
import { pathToFileURL, fileURLToPath } from 'node:url';
|
|
13
14
|
import MagicString from 'magic-string';
|
|
15
|
+
import process from 'node:process';
|
|
14
16
|
import { unlink, mkdir, writeFile, rm, readFile } from 'node:fs/promises';
|
|
15
17
|
import net from 'node:net';
|
|
16
18
|
import os from 'node:os';
|
|
17
19
|
import { Buffer } from 'node:buffer';
|
|
18
|
-
import { createError, defineEventHandler, handleCors, setHeader } from 'h3';
|
|
20
|
+
import { createError, defineLazyEventHandler, defineEventHandler, handleCors, setHeader } from 'h3';
|
|
19
21
|
import { ViteNodeServer } from 'vite-node/server';
|
|
20
22
|
import { normalizeViteManifest, precomputeDependencies } from 'vue-bundle-renderer';
|
|
21
23
|
import { provider, hasTTY, isCI } from 'std-env';
|
|
@@ -140,7 +142,7 @@ function resolveServerEntry(config) {
|
|
|
140
142
|
throw new Error("No entry found in rollupOptions.input");
|
|
141
143
|
}
|
|
142
144
|
|
|
143
|
-
const QUERY_RE$
|
|
145
|
+
const QUERY_RE$2 = /\?.+$/;
|
|
144
146
|
function TypeCheckPlugin(nuxt) {
|
|
145
147
|
let entry;
|
|
146
148
|
let sourcemap;
|
|
@@ -159,7 +161,7 @@ function TypeCheckPlugin(nuxt) {
|
|
|
159
161
|
}
|
|
160
162
|
},
|
|
161
163
|
transform(code, id) {
|
|
162
|
-
if (id.replace(QUERY_RE$
|
|
164
|
+
if (id.replace(QUERY_RE$2, "") !== entry) {
|
|
163
165
|
return;
|
|
164
166
|
}
|
|
165
167
|
const s = new MagicString(code);
|
|
@@ -172,7 +174,7 @@ function TypeCheckPlugin(nuxt) {
|
|
|
172
174
|
};
|
|
173
175
|
}
|
|
174
176
|
|
|
175
|
-
const QUERY_RE = /\?.+$/;
|
|
177
|
+
const QUERY_RE$1 = /\?.+$/;
|
|
176
178
|
function ModulePreloadPolyfillPlugin() {
|
|
177
179
|
let isDisabled = false;
|
|
178
180
|
let entry;
|
|
@@ -190,7 +192,7 @@ function ModulePreloadPolyfillPlugin() {
|
|
|
190
192
|
}
|
|
191
193
|
},
|
|
192
194
|
transform(code, id) {
|
|
193
|
-
if (isDisabled || id.replace(QUERY_RE, "") !== entry) {
|
|
195
|
+
if (isDisabled || id.replace(QUERY_RE$1, "") !== entry) {
|
|
194
196
|
return;
|
|
195
197
|
}
|
|
196
198
|
const s = new MagicString(code);
|
|
@@ -567,6 +569,7 @@ async function writeDevServer(nuxt) {
|
|
|
567
569
|
}
|
|
568
570
|
|
|
569
571
|
const PREFIX = "virtual:public?";
|
|
572
|
+
const PREFIX_RE = /^virtual:public\?/;
|
|
570
573
|
const CSS_URL_RE = /url\((\/[^)]+)\)/g;
|
|
571
574
|
const CSS_URL_SINGLE_RE = /url\(\/[^)]+\)/;
|
|
572
575
|
const RENDER_CHUNK_RE = /(?<= = )['"`]/;
|
|
@@ -604,18 +607,21 @@ const PublicDirsPlugin = (options) => {
|
|
|
604
607
|
},
|
|
605
608
|
load: {
|
|
606
609
|
order: "pre",
|
|
610
|
+
filter: {
|
|
611
|
+
id: PREFIX_RE
|
|
612
|
+
},
|
|
607
613
|
handler(id) {
|
|
608
|
-
|
|
609
|
-
return `import { publicAssetsURL } from '#internal/nuxt/paths';export default publicAssetsURL(${JSON.stringify(decodeURIComponent(id.slice(PREFIX.length)))})`;
|
|
610
|
-
}
|
|
614
|
+
return `import { publicAssetsURL } from '#internal/nuxt/paths';export default publicAssetsURL(${JSON.stringify(decodeURIComponent(id.slice(PREFIX.length)))})`;
|
|
611
615
|
}
|
|
612
616
|
},
|
|
613
617
|
resolveId: {
|
|
614
618
|
order: "post",
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
619
|
+
filter: {
|
|
620
|
+
id: {
|
|
621
|
+
exclude: [/^\/__skip_vite$/, /^[^/]/, /^\/@fs/]
|
|
618
622
|
}
|
|
623
|
+
},
|
|
624
|
+
handler(id) {
|
|
619
625
|
if (resolveFromPublicAssets(id)) {
|
|
620
626
|
return PREFIX + encodeURIComponent(id);
|
|
621
627
|
}
|
|
@@ -973,34 +979,64 @@ function DevServerPlugin(nuxt) {
|
|
|
973
979
|
));
|
|
974
980
|
}
|
|
975
981
|
}
|
|
976
|
-
const viteMiddleware =
|
|
977
|
-
const
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
+
const viteMiddleware = defineLazyEventHandler(() => {
|
|
983
|
+
const proxyConfig = viteServer.config.server.proxy;
|
|
984
|
+
const proxyPatterns = [];
|
|
985
|
+
if (proxyConfig) {
|
|
986
|
+
for (const key in proxyConfig) {
|
|
987
|
+
if (key.startsWith("^")) {
|
|
988
|
+
try {
|
|
989
|
+
proxyPatterns.push({ type: "regex", value: new RegExp(key) });
|
|
990
|
+
} catch {
|
|
991
|
+
}
|
|
992
|
+
} else {
|
|
993
|
+
proxyPatterns.push({ type: "string", value: key });
|
|
994
|
+
}
|
|
982
995
|
}
|
|
983
996
|
}
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
997
|
+
function isProxyPath(path) {
|
|
998
|
+
for (const pattern of proxyPatterns) {
|
|
999
|
+
if (pattern.type === "regex" && pattern.value.test(path)) {
|
|
1000
|
+
return true;
|
|
1001
|
+
} else if (pattern.type === "string" && path.startsWith(pattern.value)) {
|
|
1002
|
+
return true;
|
|
1003
|
+
}
|
|
990
1004
|
}
|
|
991
|
-
|
|
1005
|
+
return false;
|
|
992
1006
|
}
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
1007
|
+
return defineEventHandler(async (event) => {
|
|
1008
|
+
const isBasePath = event.path.startsWith(viteServer.config.base);
|
|
1009
|
+
let isViteRoute = isBasePath;
|
|
1010
|
+
if (!isViteRoute) {
|
|
1011
|
+
for (const viteRoute of viteServer.middlewares.stack) {
|
|
1012
|
+
if (viteRoute.route.length > 1 && event.path.startsWith(viteRoute.route)) {
|
|
1013
|
+
isViteRoute = true;
|
|
1014
|
+
break;
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
isViteRoute ||= isProxyPath(event.path);
|
|
1018
|
+
}
|
|
1019
|
+
if (!isViteRoute) {
|
|
1020
|
+
event.node.req._skip_transform = true;
|
|
1021
|
+
} else if (!useViteCors) {
|
|
1022
|
+
const isPreflight = handleCors(event, nuxt.options.devServer.cors);
|
|
1023
|
+
if (isPreflight) {
|
|
1024
|
+
return null;
|
|
1025
|
+
}
|
|
1026
|
+
setHeader(event, "Vary", "Origin");
|
|
1027
|
+
}
|
|
1028
|
+
const _originalPath = event.node.req.url;
|
|
1029
|
+
await new Promise((resolve, reject) => {
|
|
1030
|
+
viteServer.middlewares.handle(event.node.req, event.node.res, (err) => {
|
|
1031
|
+
event.node.req.url = _originalPath;
|
|
1032
|
+
return err ? reject(err) : resolve(null);
|
|
1033
|
+
});
|
|
998
1034
|
});
|
|
1035
|
+
const ended = event.node.res.writableEnded || event.handled;
|
|
1036
|
+
if (!ended && event.path.startsWith(nuxt.options.app.buildAssetsDir) && !staticBases.some((baseURL) => event.path.startsWith(baseURL)) && !devHandlerRegexes.some((regex) => regex.test(event.path))) {
|
|
1037
|
+
throw createError({ statusCode: 404 });
|
|
1038
|
+
}
|
|
999
1039
|
});
|
|
1000
|
-
const ended = event.node.res.writableEnded || event.handled;
|
|
1001
|
-
if (!ended && event.path.startsWith(nuxt.options.app.buildAssetsDir) && !staticBases.some((baseURL) => event.path.startsWith(baseURL)) && !devHandlerRegexes.some((regex) => regex.test(event.path))) {
|
|
1002
|
-
throw createError({ statusCode: 404 });
|
|
1003
|
-
}
|
|
1004
1040
|
});
|
|
1005
1041
|
await nuxt.callHook("server:devHandler", viteMiddleware);
|
|
1006
1042
|
}
|
|
@@ -1555,6 +1591,7 @@ async function resolveCSSOptions(nuxt) {
|
|
|
1555
1591
|
}
|
|
1556
1592
|
|
|
1557
1593
|
const SUPPORTED_FILES_RE = /\.(?:vue|(?:[cm]?j|t)sx?)$/;
|
|
1594
|
+
const QUERY_RE = /\?.+$/;
|
|
1558
1595
|
function SSRStylesPlugin(nuxt) {
|
|
1559
1596
|
if (nuxt.options.dev) {
|
|
1560
1597
|
return;
|
|
@@ -1585,13 +1622,22 @@ function SSRStylesPlugin(nuxt) {
|
|
|
1585
1622
|
shouldInline: nuxt.options.features.inlineStyles,
|
|
1586
1623
|
globalCSS: nuxt.options.css
|
|
1587
1624
|
};
|
|
1588
|
-
const
|
|
1625
|
+
const relativeCache = /* @__PURE__ */ new Map();
|
|
1626
|
+
const relativeToSrcDir = (path) => {
|
|
1627
|
+
let cached = relativeCache.get(path);
|
|
1628
|
+
if (cached === void 0) {
|
|
1629
|
+
cached = relative(nuxt.options.srcDir, path);
|
|
1630
|
+
relativeCache.set(path, cached);
|
|
1631
|
+
}
|
|
1632
|
+
return cached;
|
|
1633
|
+
};
|
|
1589
1634
|
const warnCache = /* @__PURE__ */ new Set();
|
|
1590
1635
|
const components = nuxt.apps.default.components || [];
|
|
1591
1636
|
const islands = components.filter(
|
|
1592
1637
|
(component) => component.island || // .server components without a corresponding .client component will need to be rendered as an island
|
|
1593
1638
|
component.mode === "server" && !components.some((c) => c.pascalName === component.pascalName && c.mode === "client")
|
|
1594
1639
|
);
|
|
1640
|
+
const islandPaths = new Set(islands.map((c) => c.filePath));
|
|
1595
1641
|
let entry;
|
|
1596
1642
|
return {
|
|
1597
1643
|
name: "ssr-styles",
|
|
@@ -1606,18 +1652,21 @@ function SSRStylesPlugin(nuxt) {
|
|
|
1606
1652
|
enforce: "pre",
|
|
1607
1653
|
resolveId: {
|
|
1608
1654
|
order: "pre",
|
|
1655
|
+
filter: {
|
|
1656
|
+
id: {
|
|
1657
|
+
include: [/^#build\/css$/, /\.vue$/, IS_CSS_RE]
|
|
1658
|
+
}
|
|
1659
|
+
},
|
|
1609
1660
|
async handler(id, importer, _options) {
|
|
1610
1661
|
if (options.shouldInline === false || typeof options.shouldInline === "function" && !options.shouldInline(importer)) {
|
|
1611
1662
|
return;
|
|
1612
1663
|
}
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
};
|
|
1620
|
-
}
|
|
1664
|
+
const res = await this.resolve(id, importer, { ..._options, skipSelf: true });
|
|
1665
|
+
if (res) {
|
|
1666
|
+
return {
|
|
1667
|
+
...res,
|
|
1668
|
+
moduleSideEffects: false
|
|
1669
|
+
};
|
|
1621
1670
|
}
|
|
1622
1671
|
}
|
|
1623
1672
|
},
|
|
@@ -1702,7 +1751,7 @@ function SSRStylesPlugin(nuxt) {
|
|
|
1702
1751
|
}
|
|
1703
1752
|
const relativePath = relativeToSrcDir(moduleId);
|
|
1704
1753
|
if (relativePath in cssMap) {
|
|
1705
|
-
cssMap[relativePath].inBundle = cssMap[relativePath].inBundle ?? (isVue(moduleId) && !!
|
|
1754
|
+
cssMap[relativePath].inBundle = cssMap[relativePath].inBundle ?? (isVue(moduleId) && !!relativePath || isEntry);
|
|
1706
1755
|
}
|
|
1707
1756
|
}
|
|
1708
1757
|
return null;
|
|
@@ -1739,14 +1788,14 @@ function SSRStylesPlugin(nuxt) {
|
|
|
1739
1788
|
return;
|
|
1740
1789
|
}
|
|
1741
1790
|
const { pathname, search } = parseURL(decodeURIComponent(pathToFileURL(id).href));
|
|
1742
|
-
if (!(id in clientCSSMap) && !
|
|
1791
|
+
if (!(id in clientCSSMap) && !islandPaths.has(pathname)) {
|
|
1743
1792
|
return;
|
|
1744
1793
|
}
|
|
1745
1794
|
const query = parseQuery(search);
|
|
1746
1795
|
if (query.macro || query.nuxt_component) {
|
|
1747
1796
|
return;
|
|
1748
1797
|
}
|
|
1749
|
-
if (!
|
|
1798
|
+
if (!islandPaths.has(pathname)) {
|
|
1750
1799
|
if (options.shouldInline === false || typeof options.shouldInline === "function" && !options.shouldInline(id)) {
|
|
1751
1800
|
return;
|
|
1752
1801
|
}
|
|
@@ -1754,11 +1803,16 @@ function SSRStylesPlugin(nuxt) {
|
|
|
1754
1803
|
const relativeId = relativeToSrcDir(id);
|
|
1755
1804
|
const idMap = cssMap[relativeId] ||= { files: [] };
|
|
1756
1805
|
const emittedIds = /* @__PURE__ */ new Set();
|
|
1806
|
+
const idFilename = filename(id);
|
|
1757
1807
|
let styleCtr = 0;
|
|
1758
1808
|
const ids = clientCSSMap[id] || [];
|
|
1759
1809
|
for (const file of ids) {
|
|
1810
|
+
if (emittedIds.has(file)) {
|
|
1811
|
+
continue;
|
|
1812
|
+
}
|
|
1813
|
+
const fileInline = file + "?inline&used";
|
|
1760
1814
|
const resolved = await this.resolve(file) ?? await this.resolve(file, id);
|
|
1761
|
-
const res = await this.resolve(
|
|
1815
|
+
const res = await this.resolve(fileInline) ?? await this.resolve(fileInline, id);
|
|
1762
1816
|
if (!resolved || !res) {
|
|
1763
1817
|
if (!warnCache.has(file)) {
|
|
1764
1818
|
warnCache.add(file);
|
|
@@ -1766,13 +1820,11 @@ function SSRStylesPlugin(nuxt) {
|
|
|
1766
1820
|
}
|
|
1767
1821
|
continue;
|
|
1768
1822
|
}
|
|
1769
|
-
|
|
1770
|
-
continue;
|
|
1771
|
-
}
|
|
1823
|
+
emittedIds.add(file);
|
|
1772
1824
|
const ref = this.emitFile({
|
|
1773
1825
|
type: "chunk",
|
|
1774
|
-
name: `${
|
|
1775
|
-
id:
|
|
1826
|
+
name: `${idFilename}-styles-${++styleCtr}.mjs`,
|
|
1827
|
+
id: fileInline
|
|
1776
1828
|
});
|
|
1777
1829
|
idRefMap[relativeToSrcDir(file)] = ref;
|
|
1778
1830
|
idMap.files.push(ref);
|
|
@@ -1781,15 +1833,15 @@ function SSRStylesPlugin(nuxt) {
|
|
|
1781
1833
|
return;
|
|
1782
1834
|
}
|
|
1783
1835
|
for (const i of findStaticImports(code)) {
|
|
1784
|
-
|
|
1785
|
-
if (type !== "style" && !i.specifier.endsWith(".css")) {
|
|
1836
|
+
if (!i.specifier.endsWith(".css") && parseQuery(i.specifier).type !== "style") {
|
|
1786
1837
|
continue;
|
|
1787
1838
|
}
|
|
1788
1839
|
const resolved = await this.resolve(i.specifier, id);
|
|
1789
1840
|
if (!resolved) {
|
|
1790
1841
|
continue;
|
|
1791
1842
|
}
|
|
1792
|
-
|
|
1843
|
+
const resolvedIdInline = resolved.id + "?inline&used";
|
|
1844
|
+
if (!await this.resolve(resolvedIdInline)) {
|
|
1793
1845
|
if (!warnCache.has(resolved.id)) {
|
|
1794
1846
|
warnCache.add(resolved.id);
|
|
1795
1847
|
this.warn(`[nuxt] Cannot extract styles for \`${i.specifier}\`. Its styles will not be inlined when server-rendering.`);
|
|
@@ -1801,8 +1853,8 @@ function SSRStylesPlugin(nuxt) {
|
|
|
1801
1853
|
}
|
|
1802
1854
|
const ref = this.emitFile({
|
|
1803
1855
|
type: "chunk",
|
|
1804
|
-
name: `${
|
|
1805
|
-
id:
|
|
1856
|
+
name: `${idFilename}-styles-${++styleCtr}.mjs`,
|
|
1857
|
+
id: resolvedIdInline
|
|
1806
1858
|
});
|
|
1807
1859
|
idRefMap[relativeToSrcDir(resolved.id)] = ref;
|
|
1808
1860
|
idMap.files.push(ref);
|
|
@@ -1813,7 +1865,7 @@ function SSRStylesPlugin(nuxt) {
|
|
|
1813
1865
|
};
|
|
1814
1866
|
}
|
|
1815
1867
|
function filename(name) {
|
|
1816
|
-
return filename$1(name.replace(
|
|
1868
|
+
return filename$1(name.replace(QUERY_RE, ""));
|
|
1817
1869
|
}
|
|
1818
1870
|
|
|
1819
1871
|
function ReplacePlugin() {
|
|
@@ -1830,8 +1882,8 @@ function ReplacePlugin() {
|
|
|
1830
1882
|
}
|
|
1831
1883
|
}
|
|
1832
1884
|
}
|
|
1833
|
-
if (vite.rolldownVersion) {
|
|
1834
|
-
const { replacePlugin: replacePlugin2 } = await import('rolldown/
|
|
1885
|
+
if (config.isProduction && vite.rolldownVersion) {
|
|
1886
|
+
const { replacePlugin: replacePlugin2 } = await import('rolldown/plugins');
|
|
1835
1887
|
return replacePlugin2(replaceOptions, { preventAssignment: true });
|
|
1836
1888
|
} else {
|
|
1837
1889
|
return replacePlugin({ ...replaceOptions, preventAssignment: true });
|
|
@@ -1886,6 +1938,8 @@ function EnvironmentsPlugin(nuxt) {
|
|
|
1886
1938
|
let viteConfig;
|
|
1887
1939
|
return {
|
|
1888
1940
|
name: "nuxt:environments",
|
|
1941
|
+
enforce: "pre",
|
|
1942
|
+
// run before other plugins
|
|
1889
1943
|
config(config) {
|
|
1890
1944
|
viteConfig = config;
|
|
1891
1945
|
if (!nuxt.options.dev) {
|
|
@@ -1935,7 +1989,12 @@ function EnvironmentsPlugin(nuxt) {
|
|
|
1935
1989
|
{
|
|
1936
1990
|
name: "nuxt:client:aliases",
|
|
1937
1991
|
enforce: "post",
|
|
1938
|
-
resolveId:
|
|
1992
|
+
resolveId: {
|
|
1993
|
+
filter: {
|
|
1994
|
+
id: Object.keys(clientAliases).map((id) => new RegExp("^" + escapeStringRegexp(id) + "$"))
|
|
1995
|
+
},
|
|
1996
|
+
handler: (source) => clientAliases[source]
|
|
1997
|
+
}
|
|
1939
1998
|
}
|
|
1940
1999
|
];
|
|
1941
2000
|
} else if (environment.name === "ssr") ;
|
|
@@ -2140,7 +2199,7 @@ const bundle = async (nuxt) => {
|
|
|
2140
2199
|
return relativeSourcePath.includes("node_modules") || relativeSourcePath.includes(nuxt.options.buildDir);
|
|
2141
2200
|
},
|
|
2142
2201
|
sanitizeFileName: sanitizeFilePath,
|
|
2143
|
-
// https://github.com/vitejs/vite/
|
|
2202
|
+
// https://github.com/vitejs/vite/blob/main/packages/vite/src/node/build.ts#L464-L478
|
|
2144
2203
|
assetFileNames: nuxt.options.dev ? void 0 : (chunk) => withoutLeadingSlash(join(nuxt.options.app.buildAssetsDir, `${sanitizeFilePath(filename$1(chunk.names[0]))}.[hash].[ext]`))
|
|
2145
2204
|
}
|
|
2146
2205
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxt/vite-builder-nightly",
|
|
3
|
-
"version": "4.3.0-
|
|
3
|
+
"version": "4.3.0-29430616.754c35a4",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/nuxt/nuxt.git",
|
|
@@ -21,29 +21,29 @@
|
|
|
21
21
|
"dist"
|
|
22
22
|
],
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@nuxt/schema": "npm:@nuxt/schema-nightly@4.3.0-
|
|
25
|
-
"nitropack": "2.12.
|
|
26
|
-
"rolldown": "1.0.0-beta.
|
|
27
|
-
"rollup": "4.
|
|
24
|
+
"@nuxt/schema": "npm:@nuxt/schema-nightly@4.3.0-29430616.754c35a4",
|
|
25
|
+
"nitropack": "2.12.9",
|
|
26
|
+
"rolldown": "1.0.0-beta.53",
|
|
27
|
+
"rollup": "4.53.3",
|
|
28
28
|
"unbuild": "3.6.1",
|
|
29
|
-
"vue": "3.5.
|
|
29
|
+
"vue": "3.5.25"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@nuxt/kit": "npm:@nuxt/kit-nightly@4.3.0-
|
|
33
|
-
"@rollup/plugin-replace": "^6.0.
|
|
34
|
-
"@vitejs/plugin-vue": "^6.0.
|
|
35
|
-
"@vitejs/plugin-vue-jsx": "^5.1.
|
|
36
|
-
"autoprefixer": "^10.4.
|
|
32
|
+
"@nuxt/kit": "npm:@nuxt/kit-nightly@4.3.0-29430616.754c35a4",
|
|
33
|
+
"@rollup/plugin-replace": "^6.0.3",
|
|
34
|
+
"@vitejs/plugin-vue": "^6.0.2",
|
|
35
|
+
"@vitejs/plugin-vue-jsx": "^5.1.2",
|
|
36
|
+
"autoprefixer": "^10.4.22",
|
|
37
37
|
"consola": "^3.4.2",
|
|
38
|
-
"cssnano": "^7.1.
|
|
38
|
+
"cssnano": "^7.1.2",
|
|
39
39
|
"defu": "^6.1.4",
|
|
40
|
-
"esbuild": "^0.
|
|
40
|
+
"esbuild": "^0.27.1",
|
|
41
41
|
"escape-string-regexp": "^5.0.0",
|
|
42
|
-
"exsolve": "^1.0.
|
|
42
|
+
"exsolve": "^1.0.8",
|
|
43
43
|
"get-port-please": "^3.2.0",
|
|
44
44
|
"h3": "^1.15.4",
|
|
45
45
|
"jiti": "^2.6.1",
|
|
46
|
-
"knitwork": "^1.
|
|
46
|
+
"knitwork": "^1.3.0",
|
|
47
47
|
"magic-string": "^0.30.21",
|
|
48
48
|
"mlly": "^1.8.0",
|
|
49
49
|
"mocked-exports": "^0.1.1",
|
|
@@ -51,17 +51,17 @@
|
|
|
51
51
|
"pkg-types": "^2.3.0",
|
|
52
52
|
"postcss": "^8.5.6",
|
|
53
53
|
"rollup-plugin-visualizer": "^6.0.5",
|
|
54
|
-
"seroval": "^1.
|
|
54
|
+
"seroval": "^1.4.0",
|
|
55
55
|
"std-env": "^3.10.0",
|
|
56
56
|
"ufo": "^1.6.1",
|
|
57
|
-
"unenv": "^2.0.0-rc.
|
|
58
|
-
"vite": "^7.
|
|
59
|
-
"vite-node": "^
|
|
60
|
-
"vite-plugin-checker": "^0.
|
|
57
|
+
"unenv": "^2.0.0-rc.24",
|
|
58
|
+
"vite": "^7.2.7",
|
|
59
|
+
"vite-node": "^5.2.0",
|
|
60
|
+
"vite-plugin-checker": "^0.12.0",
|
|
61
61
|
"vue-bundle-renderer": "^2.2.0"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
|
-
"nuxt": "npm:nuxt-nightly@4.3.0-
|
|
64
|
+
"nuxt": "npm:nuxt-nightly@4.3.0-29430616.754c35a4",
|
|
65
65
|
"rolldown": "^1.0.0-beta.38",
|
|
66
66
|
"vue": "^3.3.4"
|
|
67
67
|
},
|
|
@@ -75,6 +75,7 @@
|
|
|
75
75
|
},
|
|
76
76
|
"_name": "@nuxt/vite-builder",
|
|
77
77
|
"scripts": {
|
|
78
|
+
"build:stub": "unbuild --stub",
|
|
78
79
|
"test:attw": "attw --pack"
|
|
79
80
|
}
|
|
80
81
|
}
|