@normed/bundle 4.5.1 → 4.5.2
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/CHANGELOG.md +4 -0
- package/bundles/bin/cli.js +12 -2
- package/bundles/bin/cli.js.map +2 -2
- package/bundles/index.js +12 -2
- package/bundles/index.js.map +2 -2
- package/package.json +1 -1
package/bundles/index.js
CHANGED
|
@@ -69240,6 +69240,7 @@ async function processHtmlAssets(html, pugFilePath, options) {
|
|
|
69240
69240
|
const hashedPath = await processAsset(
|
|
69241
69241
|
assetPath,
|
|
69242
69242
|
pugDir,
|
|
69243
|
+
pugFilePath,
|
|
69243
69244
|
outdir,
|
|
69244
69245
|
outbase,
|
|
69245
69246
|
assetNames,
|
|
@@ -69269,6 +69270,7 @@ async function processHtmlAssets(html, pugFilePath, options) {
|
|
|
69269
69270
|
const hashedPath = await processAsset(
|
|
69270
69271
|
value,
|
|
69271
69272
|
pugDir,
|
|
69273
|
+
pugFilePath,
|
|
69272
69274
|
outdir,
|
|
69273
69275
|
outbase,
|
|
69274
69276
|
assetNames,
|
|
@@ -69287,7 +69289,7 @@ async function processHtmlAssets(html, pugFilePath, options) {
|
|
|
69287
69289
|
}
|
|
69288
69290
|
return { html: modifiedHtml, assets, pugReferences };
|
|
69289
69291
|
}
|
|
69290
|
-
async function processAsset(assetPath, pugDir, outdir, outbase, assetNames, publicPath, assets, processedAssets) {
|
|
69292
|
+
async function processAsset(assetPath, pugDir, pugFilePath, outdir, outbase, assetNames, publicPath, assets, processedAssets) {
|
|
69291
69293
|
const absoluteSource = import_path5.default.resolve(pugDir, assetPath);
|
|
69292
69294
|
if (processedAssets.has(absoluteSource)) {
|
|
69293
69295
|
return processedAssets.get(absoluteSource);
|
|
@@ -69305,7 +69307,15 @@ async function processAsset(assetPath, pugDir, outdir, outbase, assetNames, publ
|
|
|
69305
69307
|
outbase
|
|
69306
69308
|
);
|
|
69307
69309
|
const absoluteOutput = import_path5.default.join(outdir, hashedFilename);
|
|
69308
|
-
const
|
|
69310
|
+
const pugRelativeToOutbase = import_path5.default.relative(outbase, pugFilePath);
|
|
69311
|
+
const htmlOutputPath = import_path5.default.join(outdir, pugRelativeToOutbase);
|
|
69312
|
+
const htmlOutputDir = import_path5.default.dirname(htmlOutputPath);
|
|
69313
|
+
let htmlPath;
|
|
69314
|
+
if (publicPath) {
|
|
69315
|
+
htmlPath = publicPath.replace(/\/$/, "") + "/" + hashedFilename;
|
|
69316
|
+
} else {
|
|
69317
|
+
htmlPath = import_path5.default.relative(htmlOutputDir, absoluteOutput);
|
|
69318
|
+
}
|
|
69309
69319
|
assets.push({
|
|
69310
69320
|
originalPath: assetPath,
|
|
69311
69321
|
hashedPath: htmlPath,
|