nitropack-nightly 2.13.0-20251216-105758-87755495 → 2.13.0-20251216-114648-67f152cf
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/core/index.mjs
CHANGED
|
@@ -1728,8 +1728,9 @@ async function compressPublicAssets(nitro) {
|
|
|
1728
1728
|
dot: true,
|
|
1729
1729
|
ignore: ["**/*.gz", "**/*.br"]
|
|
1730
1730
|
});
|
|
1731
|
-
await
|
|
1732
|
-
|
|
1731
|
+
await runParallel(
|
|
1732
|
+
new Set(publicFiles),
|
|
1733
|
+
async (fileName) => {
|
|
1733
1734
|
const filePath = resolve(nitro.options.output.publicDir, fileName);
|
|
1734
1735
|
if (existsSync(filePath + ".gz") || existsSync(filePath + ".br")) {
|
|
1735
1736
|
return;
|
|
@@ -1770,7 +1771,8 @@ async function compressPublicAssets(nitro) {
|
|
|
1770
1771
|
await fsp.writeFile(compressedPath, compressedBuff);
|
|
1771
1772
|
})
|
|
1772
1773
|
);
|
|
1773
|
-
}
|
|
1774
|
+
},
|
|
1775
|
+
{ concurrency: 10 }
|
|
1774
1776
|
);
|
|
1775
1777
|
}
|
|
1776
1778
|
function isTextMime(mimeType) {
|
package/dist/meta/index.mjs
CHANGED
package/dist/rollup/index.mjs
CHANGED
|
@@ -1259,6 +1259,14 @@ function publicAssets(nitro) {
|
|
|
1259
1259
|
data: nitro.options.serveStatic === "inline" ? assetData.toString("base64") : void 0
|
|
1260
1260
|
};
|
|
1261
1261
|
}
|
|
1262
|
+
for (const key in assets) {
|
|
1263
|
+
if (/\.(gz|br)$/.test(key)) {
|
|
1264
|
+
const originalKey = key.replace(/\.(gz|br)$/, "");
|
|
1265
|
+
if (assets[originalKey] && assets[originalKey].encoding === void 0) {
|
|
1266
|
+
assets[originalKey].encoding = null;
|
|
1267
|
+
}
|
|
1268
|
+
}
|
|
1269
|
+
}
|
|
1262
1270
|
return `export default ${JSON.stringify(assets, null, 2)};`;
|
|
1263
1271
|
},
|
|
1264
1272
|
// #nitro-internal-virtual/public-assets-node
|
|
@@ -37,9 +37,6 @@ export default eventHandler((event) => {
|
|
|
37
37
|
...encodingHeader.split(",").map((e) => EncodingMap[e.trim()]).filter(Boolean).sort(),
|
|
38
38
|
""
|
|
39
39
|
];
|
|
40
|
-
if (encodings.length > 1) {
|
|
41
|
-
appendResponseHeader(event, "Vary", "Accept-Encoding");
|
|
42
|
-
}
|
|
43
40
|
for (const encoding of encodings) {
|
|
44
41
|
for (const _id of [id + encoding, joinURL(id, "index.html" + encoding)]) {
|
|
45
42
|
const _asset = getAsset(_id);
|
|
@@ -57,6 +54,9 @@ export default eventHandler((event) => {
|
|
|
57
54
|
}
|
|
58
55
|
return;
|
|
59
56
|
}
|
|
57
|
+
if (asset.encoding !== void 0) {
|
|
58
|
+
appendResponseHeader(event, "Vary", "Accept-Encoding");
|
|
59
|
+
}
|
|
60
60
|
const ifNotMatch = getRequestHeader(event, "if-none-match") === asset.etag;
|
|
61
61
|
if (ifNotMatch) {
|
|
62
62
|
setResponseStatus(event, 304, "Not Modified");
|
package/dist/types/index.d.mts
CHANGED
package/dist/types/index.d.ts
CHANGED
package/package.json
CHANGED