@nuxt/webpack-builder-nightly 5.0.0-29778992.0756eea3 → 5.0.0-29779020.52bfb589
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/dist/index.mjs +14 -10
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -211,9 +211,9 @@ var SSRStylesPlugin = class {
|
|
|
211
211
|
escapeTemplateLiteral(str) {
|
|
212
212
|
return str.replace(/[`\\$]/g, (m) => m === "$" ? "\\$" : `\\${m}`);
|
|
213
213
|
}
|
|
214
|
-
|
|
214
|
+
buildAssetPath(url) {
|
|
215
215
|
const buildDir = withTrailingSlash(this.nuxt.options.app.buildAssetsDir || "/_nuxt/");
|
|
216
|
-
return url.startsWith(buildDir);
|
|
216
|
+
return url.startsWith(buildDir) ? url.slice(buildDir.length) : null;
|
|
217
217
|
}
|
|
218
218
|
isPublicAsset(url, nitro) {
|
|
219
219
|
const cleaned = url.replace(/[?#].*$/, "");
|
|
@@ -238,14 +238,16 @@ var SSRStylesPlugin = class {
|
|
|
238
238
|
const full = match[0];
|
|
239
239
|
const rawUrl = match[2] || "";
|
|
240
240
|
const stripped = rawUrl.replace(/[?#].*$/, "");
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
out += "${publicAssetsURL(" + JSON.stringify(rawUrl) + ")}";
|
|
245
|
-
} else if (this.isBuildAsset(stripped)) {
|
|
241
|
+
const quote = match[1] || "";
|
|
242
|
+
const buildAssetPath = this.buildAssetPath(stripped);
|
|
243
|
+
if (buildAssetPath) {
|
|
246
244
|
needsBuildAsset = true;
|
|
247
245
|
changed = true;
|
|
248
|
-
out +=
|
|
246
|
+
out += `url(${quote}\${buildAssetsURL(${JSON.stringify(buildAssetPath + rawUrl.slice(stripped.length))})}${quote})`;
|
|
247
|
+
} else if (this.isPublicAsset(stripped, nitro)) {
|
|
248
|
+
needsPublicAsset = true;
|
|
249
|
+
changed = true;
|
|
250
|
+
out += `url(${quote}\${publicAssetsURL(${JSON.stringify(rawUrl)})}${quote})`;
|
|
249
251
|
} else out += this.escapeTemplateLiteral(full);
|
|
250
252
|
lastIndex = index + full.length;
|
|
251
253
|
}
|
|
@@ -1039,6 +1041,7 @@ async function getPostcssConfig(nuxt) {
|
|
|
1039
1041
|
"postcss-url": {}
|
|
1040
1042
|
};
|
|
1041
1043
|
const postcssOptions = defu({}, nuxt.options.postcss, {
|
|
1044
|
+
config: false,
|
|
1042
1045
|
plugins: defaultPlugins,
|
|
1043
1046
|
sourceMap: nuxt.options.webpack.cssSourceMap
|
|
1044
1047
|
});
|
|
@@ -1420,7 +1423,8 @@ function clientHMR(ctx) {
|
|
|
1420
1423
|
ctx.config.entry.app.unshift(`webpack-hot-middleware/client?${hotMiddlewareClientOptionsStr}`);
|
|
1421
1424
|
}
|
|
1422
1425
|
function clientOptimization(ctx) {
|
|
1423
|
-
|
|
1426
|
+
const inlineStyles = ctx.nuxt.options.features.inlineStyles;
|
|
1427
|
+
if (!inlineStyles) return;
|
|
1424
1428
|
const globalCSSPaths = /* @__PURE__ */ new Set();
|
|
1425
1429
|
for (const css of ctx.options.css) if (typeof css === "string") {
|
|
1426
1430
|
const resolved = resolveAlias(css, ctx.options.alias);
|
|
@@ -1437,7 +1441,7 @@ function clientOptimization(ctx) {
|
|
|
1437
1441
|
test: (module) => {
|
|
1438
1442
|
if (module.type !== "css/mini-extract") return false;
|
|
1439
1443
|
const identifier = normalize(module.identifier());
|
|
1440
|
-
for (const globalPath of globalCSSPaths) if (identifier.includes(globalPath)) return
|
|
1444
|
+
for (const globalPath of globalCSSPaths) if (identifier.includes(globalPath)) return typeof inlineStyles === "boolean" ? inlineStyles : inlineStyles(module.identifier());
|
|
1441
1445
|
return false;
|
|
1442
1446
|
}
|
|
1443
1447
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxt/webpack-builder-nightly",
|
|
3
|
-
"version": "5.0.0-
|
|
3
|
+
"version": "5.0.0-29779020.52bfb589",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/nuxt/nuxt.git",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@nuxt/friendly-errors-webpack-plugin": "^2.6.0",
|
|
27
|
-
"@nuxt/kit": "npm:@nuxt/kit-nightly@5.0.0-
|
|
27
|
+
"@nuxt/kit": "npm:@nuxt/kit-nightly@5.0.0-29779020.52bfb589",
|
|
28
28
|
"@vue/compiler-sfc": "3.5.41",
|
|
29
29
|
"autoprefixer": "^10.5.4",
|
|
30
30
|
"css-loader": "^7.1.4",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"webpackbar": "^7.0.0"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@nuxt/schema": "npm:@nuxt/schema-nightly@5.0.0-
|
|
68
|
+
"@nuxt/schema": "npm:@nuxt/schema-nightly@5.0.0-29779020.52bfb589",
|
|
69
69
|
"@rspack/core": "2.1.10",
|
|
70
70
|
"@types/hash-sum": "1.0.2",
|
|
71
71
|
"@types/webpack-bundle-analyzer": "4.7.0",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"vue": "^3.5.41"
|
|
78
78
|
},
|
|
79
79
|
"peerDependencies": {
|
|
80
|
-
"nuxt": "npm:nuxt-nightly@5.0.0-
|
|
80
|
+
"nuxt": "npm:nuxt-nightly@5.0.0-29779020.52bfb589",
|
|
81
81
|
"vue": "^3.3.4"
|
|
82
82
|
},
|
|
83
83
|
"engines": {
|