@nuxt/webpack-builder-nightly 4.5.0-29706616.8737f9a1 → 4.5.0-29706750.76700a01

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 +7 -18
  2. package/package.json +5 -5
package/dist/index.mjs CHANGED
@@ -6,7 +6,7 @@ import { defu } from "defu";
6
6
  import { joinURL, withTrailingSlash } from "ufo";
7
7
  import { directoryToURL, logger, resolveAlias, useNitro, useNuxt } from "@nuxt/kit";
8
8
  import { createUnplugin } from "unplugin";
9
- import MagicString from "magic-string";
9
+ import { generateTransform, rolldownString } from "rolldown-string";
10
10
  import { MiniCssExtractPlugin, TsCheckerPlugin, WebpackBarPlugin, builder, webpack } from "#builder";
11
11
  import { existsSync, readFileSync } from "node:fs";
12
12
  import { basename, isAbsolute, join, normalize, relative, resolve } from "pathe";
@@ -31,16 +31,8 @@ import { normalizeWebpackManifest, precomputeDependencies } from "vue-bundle-ren
31
31
  import { hash } from "ohash";
32
32
  import { serialize } from "seroval";
33
33
  import { parseNodeModulePath } from "mlly";
34
- const defaults = {
35
- globalPublicPath: "__webpack_public_path__",
36
- sourcemap: true
37
- };
38
34
  const ENTRY_RE = /import ["']#build\/css["'];/;
39
- const DynamicBasePlugin = createUnplugin((options = {}) => {
40
- options = {
41
- ...defaults,
42
- ...options
43
- };
35
+ const DynamicBasePlugin = createUnplugin(() => {
44
36
  return {
45
37
  name: "nuxt:dynamic-base-path",
46
38
  enforce: "post",
@@ -49,13 +41,10 @@ const DynamicBasePlugin = createUnplugin((options = {}) => {
49
41
  id: { include: /entry/ },
50
42
  code: { include: ENTRY_RE }
51
43
  },
52
- handler(code) {
53
- const s = new MagicString(code);
54
- s.prepend(`import { buildAssetsURL } from '#internal/nuxt/paths';\n${options.globalPublicPath} = buildAssetsURL();\n`);
55
- return {
56
- code: s.toString(),
57
- map: options.sourcemap ? s.generateMap({ hires: true }) : void 0
58
- };
44
+ handler(code, id, meta) {
45
+ const s = rolldownString(code, id, meta);
46
+ s.prepend(`import { buildAssetsURL } from '#internal/nuxt/paths';\n__webpack_public_path__ = buildAssetsURL();\n`);
47
+ return generateTransform(s, id);
59
48
  }
60
49
  }
61
50
  };
@@ -1410,7 +1399,7 @@ const bundle = async (nuxt) => {
1410
1399
  const mfs = nuxt.options.dev ? createMFS() : null;
1411
1400
  const ssrStylesPlugin = nuxt.options.ssr && !nuxt.options.dev ? new SSRStylesPlugin(nuxt) : null;
1412
1401
  for (const config of webpackConfigs) {
1413
- config.plugins.push(DynamicBasePlugin.webpack({ sourcemap: !!nuxt.options.sourcemap[config.name] }));
1402
+ config.plugins.push(DynamicBasePlugin.webpack());
1414
1403
  if (config.name === "client" && nuxt.options.experimental.emitRouteChunkError && nuxt.options.builder !== "@nuxt/rspack-builder") config.plugins.push(new ChunkErrorPlugin());
1415
1404
  if (ssrStylesPlugin) config.plugins.push(ssrStylesPlugin);
1416
1405
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/webpack-builder-nightly",
3
- "version": "4.5.0-29706616.8737f9a1",
3
+ "version": "4.5.0-29706750.76700a01",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/nuxt/nuxt.git",
@@ -25,7 +25,7 @@
25
25
  ],
26
26
  "dependencies": {
27
27
  "@nuxt/friendly-errors-webpack-plugin": "^2.6.0",
28
- "@nuxt/kit": "npm:@nuxt/kit-nightly@4.5.0-29706616.8737f9a1",
28
+ "@nuxt/kit": "npm:@nuxt/kit-nightly@4.5.0-29706750.76700a01",
29
29
  "@vue/compiler-sfc": "3.5.38",
30
30
  "autoprefixer": "^10.5.1",
31
31
  "css-loader": "^7.1.4",
@@ -39,7 +39,6 @@
39
39
  "fork-ts-checker-webpack-plugin": "^9.1.0",
40
40
  "jiti": "^2.7.0",
41
41
  "knitwork": "^1.3.0",
42
- "magic-string": "^0.30.21",
43
42
  "memfs": "^4.57.8",
44
43
  "mini-css-extract-plugin": "^2.10.2",
45
44
  "mlly": "^1.8.2",
@@ -52,6 +51,7 @@
52
51
  "postcss-loader": "^8.2.1",
53
52
  "postcss-url": "^10.1.4",
54
53
  "pug-plain-loader": "^1.1.0",
54
+ "rolldown-string": "^0.3.0",
55
55
  "seroval": "^1.5.4",
56
56
  "time-fix-plugin": "^2.0.7",
57
57
  "tinyglobby": "^0.2.17",
@@ -68,7 +68,7 @@
68
68
  "webpackbar": "^7.0.0"
69
69
  },
70
70
  "devDependencies": {
71
- "@nuxt/schema": "npm:@nuxt/schema-nightly@4.5.0-29706616.8737f9a1",
71
+ "@nuxt/schema": "npm:@nuxt/schema-nightly@4.5.0-29706750.76700a01",
72
72
  "@rspack/core": "2.0.8",
73
73
  "@types/webpack-bundle-analyzer": "4.7.0",
74
74
  "@types/webpack-hot-middleware": "2.25.12",
@@ -79,7 +79,7 @@
79
79
  "vue": "3.5.38"
80
80
  },
81
81
  "peerDependencies": {
82
- "nuxt": "npm:nuxt-nightly@4.5.0-29706616.8737f9a1",
82
+ "nuxt": "npm:nuxt-nightly@4.5.0-29706750.76700a01",
83
83
  "vue": "^3.3.4"
84
84
  },
85
85
  "engines": {