@nuxt/webpack-builder-nightly 4.2.0-29331210.766a637b → 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 +16 -14
  2. package/package.json +3 -4
package/dist/index.mjs CHANGED
@@ -8,7 +8,7 @@ import { logger, 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';
11
- import { join, resolve, basename, normalize, isAbsolute } from 'pathe';
11
+ import { join, resolve, basename, normalize, dirname, isAbsolute } from 'pathe';
12
12
  import { createFsFromVolume, Volume } from 'memfs';
13
13
  import querystring from 'node:querystring';
14
14
  import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
@@ -24,9 +24,8 @@ import createResolver from 'postcss-import-resolver';
24
24
  import { createJiti } from 'jiti';
25
25
  import VueLoaderPlugin from 'vue-loader/dist/pluginWebpack5.js';
26
26
  import { mkdir, writeFile } from 'node:fs/promises';
27
- import { normalizeWebpackManifest, precomputeDependencies } from 'vue-bundle-renderer';
27
+ import { normalizeWebpackManifest } from 'vue-bundle-renderer';
28
28
  import { hash } from 'ohash';
29
- import { serialize } from 'seroval';
30
29
 
31
30
  const defaults = {
32
31
  globalPublicPath: "__webpack_public_path__",
@@ -704,11 +703,11 @@ async function createPostcssLoadersRule(ctx) {
704
703
  }
705
704
 
706
705
  class VueSSRClientPlugin {
707
- serverDist;
708
- nuxt;
706
+ options;
709
707
  constructor(options) {
710
- this.serverDist = resolve(options.nuxt.options.buildDir, "dist/server");
711
- this.nuxt = options.nuxt;
708
+ this.options = Object.assign({
709
+ filename: null
710
+ }, options);
712
711
  }
713
712
  apply(compiler) {
714
713
  compiler.hooks.afterEmit.tap("VueSSRClientPlugin", async (compilation) => {
@@ -799,12 +798,12 @@ class VueSSRClientPlugin {
799
798
  }
800
799
  }
801
800
  const manifest = normalizeWebpackManifest(webpackManifest);
802
- await this.nuxt.callHook("build:manifest", manifest);
803
- await mkdir(this.serverDist, { recursive: true });
804
- const precomputed = precomputeDependencies(manifest);
805
- await writeFile(join(this.serverDist, `client.manifest.json`), JSON.stringify(manifest, null, 2));
806
- await writeFile(join(this.serverDist, "client.manifest.mjs"), "export default " + serialize(manifest), "utf8");
807
- await writeFile(join(this.serverDist, "client.precomputed.mjs"), "export default " + serialize(precomputed), "utf8");
801
+ await this.options.nuxt.callHook("build:manifest", manifest);
802
+ const src = JSON.stringify(manifest, null, 2);
803
+ await mkdir(dirname(this.options.filename), { recursive: true });
804
+ await writeFile(this.options.filename, src);
805
+ const mjsSrc = "export default " + src;
806
+ await writeFile(this.options.filename.replace(".json", ".mjs"), mjsSrc);
808
807
  });
809
808
  }
810
809
  }
@@ -886,7 +885,10 @@ function vue(ctx) {
886
885
  options: ctx.userConfig.loaders.vue
887
886
  });
888
887
  if (ctx.isClient) {
889
- ctx.config.plugins.push(new VueSSRClientPlugin({ nuxt: ctx.nuxt }));
888
+ ctx.config.plugins.push(new VueSSRClientPlugin({
889
+ filename: resolve(ctx.options.buildDir, "dist/server", `${ctx.name}.manifest.json`),
890
+ nuxt: ctx.nuxt
891
+ }));
890
892
  } else {
891
893
  ctx.config.plugins.push(new VueSSRServerPlugin({
892
894
  filename: `${ctx.name}.manifest.json`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/webpack-builder-nightly",
3
- "version": "4.2.0-29331210.766a637b",
3
+ "version": "4.2.0-29331654.df559ad9",
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.2.0-29331210.766a637b",
30
+ "@nuxt/kit": "npm:@nuxt/kit-nightly@4.2.0-29331654.df559ad9",
31
31
  "autoprefixer": "^10.4.21",
32
32
  "css-loader": "^7.1.2",
33
33
  "css-minimizer-webpack-plugin": "^7.0.2",
@@ -52,7 +52,6 @@
52
52
  "postcss-loader": "^8.2.0",
53
53
  "postcss-url": "^10.1.3",
54
54
  "pug-plain-loader": "^1.1.0",
55
- "seroval": "^1.3.2",
56
55
  "std-env": "^3.9.0",
57
56
  "time-fix-plugin": "^2.0.7",
58
57
  "tinyglobby": "^0.2.15",
@@ -69,7 +68,7 @@
69
68
  "webpackbar": "^7.0.0"
70
69
  },
71
70
  "devDependencies": {
72
- "@nuxt/schema": "npm:@nuxt/schema-nightly@4.2.0-29331210.766a637b",
71
+ "@nuxt/schema": "npm:@nuxt/schema-nightly@4.2.0-29331654.df559ad9",
73
72
  "@rspack/core": "1.5.8",
74
73
  "@types/webpack-bundle-analyzer": "4.7.0",
75
74
  "@types/webpack-hot-middleware": "2.25.11",