@nuxt/vite-builder-nightly 4.2.0-29331232.6f9cb0d2 → 4.2.0-29331654.df559ad9

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 +15 -17
  2. package/package.json +3 -4
package/dist/index.mjs CHANGED
@@ -22,11 +22,10 @@ import net from 'node:net';
22
22
  import os from 'node:os';
23
23
  import { Buffer } from 'node:buffer';
24
24
  import { ViteNodeServer } from 'vite-node/server';
25
- import { normalizeViteManifest, precomputeDependencies } from 'vue-bundle-renderer';
25
+ import { normalizeViteManifest } from 'vue-bundle-renderer';
26
26
  import { provider, hasTTY, isCI } from 'std-env';
27
27
  import { colorize } from 'consola/utils';
28
28
  import escapeStringRegexp from 'escape-string-regexp';
29
- import { serialize } from 'seroval';
30
29
  import { isBuiltin } from 'node:module';
31
30
  import { createJiti } from 'jiti';
32
31
  import { genImport, genArrayFromRaw, genObjectFromRawEntries } from 'knitwork';
@@ -557,12 +556,16 @@ function sendError(socket, id, error) {
557
556
  async function writeDevServer(nuxt) {
558
557
  const serverResolvedPath = resolve(distDir, "runtime/vite-node.mjs");
559
558
  const manifestResolvedPath = resolve(distDir, "runtime/client.manifest.mjs");
560
- const serverDist = join(nuxt.options.buildDir, "dist/server");
561
- await mkdir(serverDist, { recursive: true });
559
+ await mkdir(join(nuxt.options.buildDir, "dist/server"), { recursive: true });
562
560
  await Promise.all([
563
- writeFile(join(serverDist, "server.mjs"), `export { default } from ${JSON.stringify(pathToFileURL(serverResolvedPath).href)}`),
564
- writeFile(join(serverDist, "client.precomputed.mjs"), `export default undefined`),
565
- writeFile(join(serverDist, "client.manifest.mjs"), `export { default } from ${JSON.stringify(pathToFileURL(manifestResolvedPath).href)}`)
561
+ writeFile(
562
+ resolve(nuxt.options.buildDir, "dist/server/server.mjs"),
563
+ `export { default } from ${JSON.stringify(pathToFileURL(serverResolvedPath).href)}`
564
+ ),
565
+ writeFile(
566
+ resolve(nuxt.options.buildDir, "dist/server/client.manifest.mjs"),
567
+ `export { default } from ${JSON.stringify(pathToFileURL(manifestResolvedPath).href)}`
568
+ )
566
569
  ]);
567
570
  }
568
571
 
@@ -1127,9 +1130,9 @@ async function writeManifest(ctx) {
1127
1130
  }
1128
1131
  const manifest = normalizeViteManifest(clientManifest);
1129
1132
  await nuxt.callHook("build:manifest", manifest);
1130
- const precomputed = precomputeDependencies(manifest);
1131
- await writeFile(resolve(serverDist, "client.manifest.mjs"), "export default " + serialize(manifest), "utf8");
1132
- await writeFile(resolve(serverDist, "client.precomputed.mjs"), "export default " + serialize(precomputed), "utf8");
1133
+ const stringifiedManifest = JSON.stringify(manifest, null, 2);
1134
+ await writeFile(resolve(serverDist, "client.manifest.json"), stringifiedManifest, "utf8");
1135
+ await writeFile(resolve(serverDist, "client.manifest.mjs"), "export default " + stringifiedManifest, "utf8");
1133
1136
  if (!nuxt.options.dev) {
1134
1137
  await rm(manifestFile, { force: true });
1135
1138
  }
@@ -1866,23 +1869,18 @@ const bundle = async (nuxt) => {
1866
1869
  entry: ctx.entry
1867
1870
  }));
1868
1871
  });
1869
- const nitro = useNitro();
1870
1872
  nuxt.hook("build:manifest", (manifest) => {
1871
- const entryIds = /* @__PURE__ */ new Set();
1872
1873
  for (const id of chunksWithInlinedCSS) {
1873
1874
  const chunk = manifest[id];
1874
1875
  if (!chunk) {
1875
1876
  continue;
1876
1877
  }
1877
- if (chunk.isEntry && chunk.src) {
1878
- entryIds.add(chunk.src);
1878
+ if (chunk.isEntry) {
1879
+ chunk._globalCSS = true;
1879
1880
  } else {
1880
1881
  chunk.css &&= [];
1881
1882
  }
1882
1883
  }
1883
- nitro.options.virtual["#internal/nuxt/entry-ids.mjs"] = () => `export default ${JSON.stringify(Array.from(entryIds))}`;
1884
- nitro.options._config.virtual ||= {};
1885
- nitro.options._config.virtual["#internal/nuxt/entry-ids.mjs"] = nitro.options.virtual["#internal/nuxt/entry-ids.mjs"];
1886
1884
  });
1887
1885
  }
1888
1886
  nuxt.hook("vite:serverCreated", (server, env) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/vite-builder-nightly",
3
- "version": "4.2.0-29331232.6f9cb0d2",
3
+ "version": "4.2.0-29331654.df559ad9",
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.2.0-29331232.6f9cb0d2",
24
+ "@nuxt/schema": "npm:@nuxt/schema-nightly@4.2.0-29331654.df559ad9",
25
25
  "nitropack": "2.12.6",
26
26
  "rolldown": "1.0.0-beta.42",
27
27
  "rollup": "4.52.4",
@@ -29,7 +29,7 @@
29
29
  "vue": "3.5.22"
30
30
  },
31
31
  "dependencies": {
32
- "@nuxt/kit": "npm:@nuxt/kit-nightly@4.2.0-29331232.6f9cb0d2",
32
+ "@nuxt/kit": "npm:@nuxt/kit-nightly@4.2.0-29331654.df559ad9",
33
33
  "@rollup/plugin-replace": "^6.0.2",
34
34
  "@vitejs/plugin-vue": "^6.0.1",
35
35
  "@vitejs/plugin-vue-jsx": "^5.1.1",
@@ -51,7 +51,6 @@
51
51
  "pkg-types": "^2.3.0",
52
52
  "postcss": "^8.5.6",
53
53
  "rollup-plugin-visualizer": "^6.0.4",
54
- "seroval": "^1.3.2",
55
54
  "std-env": "^3.9.0",
56
55
  "ufo": "^1.6.1",
57
56
  "unenv": "^2.0.0-rc.21",