@nuxt/vite-builder-nightly 4.0.0-28808006.e95edac5 → 4.0.0-28808068.01bee2f0

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.
Files changed (2) hide show
  1. package/dist/index.mjs +9 -67
  2. package/package.json +3 -3
package/dist/index.mjs CHANGED
@@ -212,7 +212,7 @@ function viteNodePlugin(ctx) {
212
212
  configureServer(server) {
213
213
  function invalidateVirtualModules() {
214
214
  for (const [id, mod] of server.moduleGraph.idToModuleMap) {
215
- if (id.startsWith("virtual:")) {
215
+ if (id.startsWith("virtual:") || id.startsWith("\0virtual:")) {
216
216
  markInvalidate(mod);
217
217
  }
218
218
  }
@@ -351,7 +351,7 @@ async function initViteNodeServer(ctx) {
351
351
  );
352
352
  }
353
353
 
354
- const PREFIX$1 = "virtual:public?";
354
+ const PREFIX = "virtual:public?";
355
355
  const CSS_URL_RE = /url\((\/[^)]+)\)/g;
356
356
  const CSS_URL_SINGLE_RE = /url\(\/[^)]+\)/;
357
357
  const VitePublicDirsPlugin = createUnplugin((options) => {
@@ -386,8 +386,8 @@ const VitePublicDirsPlugin = createUnplugin((options) => {
386
386
  load: {
387
387
  enforce: "pre",
388
388
  handler(id) {
389
- if (id.startsWith(PREFIX$1)) {
390
- return `import { publicAssetsURL } from '#internal/nuxt/paths';export default publicAssetsURL(${JSON.stringify(decodeURIComponent(id.slice(PREFIX$1.length)))})`;
389
+ if (id.startsWith(PREFIX)) {
390
+ return `import { publicAssetsURL } from '#internal/nuxt/paths';export default publicAssetsURL(${JSON.stringify(decodeURIComponent(id.slice(PREFIX.length)))})`;
391
391
  }
392
392
  }
393
393
  },
@@ -398,7 +398,7 @@ const VitePublicDirsPlugin = createUnplugin((options) => {
398
398
  return;
399
399
  }
400
400
  if (resolveFromPublicAssets(id)) {
401
- return PREFIX$1 + encodeURIComponent(id);
401
+ return PREFIX + encodeURIComponent(id);
402
402
  }
403
403
  }
404
404
  },
@@ -627,9 +627,7 @@ async function buildClient(ctx) {
627
627
  alias: {
628
628
  ...nodeCompat.alias,
629
629
  ...ctx.config.resolve?.alias,
630
- "#internal/nuxt/paths": resolve$1(ctx.nuxt.options.buildDir, "paths.mjs"),
631
- "#build/plugins": resolve$1(ctx.nuxt.options.buildDir, "plugins/client"),
632
- "nitro/runtime": resolve$1(ctx.nuxt.options.buildDir, "nitro.client.mjs")
630
+ "nitro/runtime": join(ctx.nuxt.options.buildDir, "nitro.client.mjs")
633
631
  },
634
632
  dedupe: [
635
633
  "vue"
@@ -922,11 +920,7 @@ async function buildServer(ctx) {
922
920
  noDiscovery: true
923
921
  },
924
922
  resolve: {
925
- conditions: ctx.nuxt._nitro?.options.exportConditions,
926
- alias: {
927
- "#internal/nuxt/paths": resolve$1(ctx.nuxt.options.buildDir, "paths.mjs"),
928
- "#build/plugins": resolve$1(ctx.nuxt.options.buildDir, "plugins/server")
929
- }
923
+ conditions: ctx.nuxt._nitro?.options.exportConditions
930
924
  },
931
925
  ssr: {
932
926
  external: [
@@ -1051,53 +1045,6 @@ async function buildServer(ctx) {
1051
1045
  await initViteNodeServer(ctx);
1052
1046
  }
1053
1047
 
1054
- const PREFIX = "virtual:nuxt:";
1055
- function virtual(vfs) {
1056
- const extensions = ["", ".ts", ".vue", ".mjs", ".cjs", ".js", ".json"];
1057
- const resolveWithExt = (id) => {
1058
- for (const ext of extensions) {
1059
- const rId = id + ext;
1060
- if (rId in vfs) {
1061
- return rId;
1062
- }
1063
- }
1064
- return null;
1065
- };
1066
- return {
1067
- name: "virtual",
1068
- resolveId(id, importer) {
1069
- if (process.platform === "win32" && isAbsolute(id)) {
1070
- id = resolve$1(id);
1071
- }
1072
- const resolvedId = resolveWithExt(id);
1073
- if (resolvedId) {
1074
- return PREFIX + resolvedId;
1075
- }
1076
- if (importer && !isAbsolute(id)) {
1077
- const importerNoPrefix = importer.startsWith(PREFIX) ? importer.slice(PREFIX.length) : importer;
1078
- const importedDir = dirname(importerNoPrefix);
1079
- const resolved = resolveWithExt(join(importedDir, id));
1080
- if (resolved) {
1081
- return PREFIX + resolved;
1082
- }
1083
- }
1084
- return null;
1085
- },
1086
- load(id) {
1087
- if (!id.startsWith(PREFIX)) {
1088
- return null;
1089
- }
1090
- const idNoPrefix = id.slice(PREFIX.length);
1091
- if (idNoPrefix in vfs) {
1092
- return {
1093
- code: vfs[idNoPrefix] || "",
1094
- map: null
1095
- };
1096
- }
1097
- }
1098
- };
1099
- }
1100
-
1101
1048
  function fileToUrl(file, root) {
1102
1049
  const url = relative(root, file);
1103
1050
  if (url[0] === ".") {
@@ -1647,10 +1594,6 @@ const bundle = async (nuxt) => {
1647
1594
  alias: {
1648
1595
  ...nuxt.options.alias,
1649
1596
  "#app": nuxt.options.appDir,
1650
- // We need this resolution to be present before the following entry, but it
1651
- // will be filled in client/server configs
1652
- "#build/plugins": "",
1653
- "#build": nuxt.options.buildDir,
1654
1597
  "web-streams-polyfill/ponyfill/es2018": "unenv/runtime/mock/empty",
1655
1598
  // Cannot destructure property 'AbortController' of ..
1656
1599
  "abort-controller": "unenv/runtime/mock/empty"
@@ -1689,8 +1632,7 @@ const bundle = async (nuxt) => {
1689
1632
  rootDir: nuxt.options.rootDir,
1690
1633
  composables: nuxt.options.optimization.keyedComposables
1691
1634
  }),
1692
- replace({ preventAssignment: true, ...globalThisReplacements }),
1693
- virtual(nuxt.vfs)
1635
+ replace({ preventAssignment: true, ...globalThisReplacements })
1694
1636
  ],
1695
1637
  server: {
1696
1638
  watch: { ignored: isIgnored },
@@ -1785,7 +1727,7 @@ const bundle = async (nuxt) => {
1785
1727
  nuxt.hook("vite:serverCreated", (server, env) => {
1786
1728
  ctx.nuxt.hook("app:templatesGenerated", () => {
1787
1729
  for (const [id, mod] of server.moduleGraph.idToModuleMap) {
1788
- if (id.startsWith("virtual:")) {
1730
+ if (id.startsWith("virtual:") || id.startsWith("\0virtual:")) {
1789
1731
  server.moduleGraph.invalidateModule(mod);
1790
1732
  }
1791
1733
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/vite-builder-nightly",
3
- "version": "4.0.0-28808006.e95edac5",
3
+ "version": "4.0.0-28808068.01bee2f0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/nuxt/nuxt.git",
@@ -21,7 +21,7 @@
21
21
  "dist"
22
22
  ],
23
23
  "devDependencies": {
24
- "@nuxt/schema": "npm:@nuxt/schema-nightly@4.0.0-28808006.e95edac5",
24
+ "@nuxt/schema": "npm:@nuxt/schema-nightly@4.0.0-28808068.01bee2f0",
25
25
  "@types/clear": "0.1.4",
26
26
  "@types/estree": "1.0.6",
27
27
  "rollup": "4.24.0",
@@ -29,7 +29,7 @@
29
29
  "vue": "3.5.11"
30
30
  },
31
31
  "dependencies": {
32
- "@nuxt/kit": "npm:@nuxt/kit-nightly@4.0.0-28808006.e95edac5",
32
+ "@nuxt/kit": "npm:@nuxt/kit-nightly@4.0.0-28808068.01bee2f0",
33
33
  "@rollup/plugin-replace": "^6.0.1",
34
34
  "@vitejs/plugin-vue": "^5.1.4",
35
35
  "@vitejs/plugin-vue-jsx": "^4.0.1",