@stacksjs/stx 0.2.193 → 0.2.195
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/build-externalize-repeated.d.ts +34 -0
- package/dist/build-externalize-repeated.js +101 -0
- package/dist/cli.js +902 -902
- package/dist/craft.js +232 -232
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/pwa.js +252 -252
- package/dist/site-builder/build.js +4 -0
- package/dist/ssg.js +427 -427
- package/dist/variable-extractor.js +12 -2
- package/package.json +5 -5
|
@@ -15,6 +15,7 @@ import process from "node:process";
|
|
|
15
15
|
import stxPlugin from "bun-plugin-stx";
|
|
16
16
|
import { CONVENTIONAL_ASSET_OUTPUT, resolveConventionalAssetRoot } from "../asset-roots.js";
|
|
17
17
|
import { externalizeSharedAssets } from "../build-externalize.js";
|
|
18
|
+
import { externalizeRepeatedAssets } from "../build-externalize-repeated.js";
|
|
18
19
|
import { injectCrosswindCSS } from "../dev-server/crosswind.js";
|
|
19
20
|
import { injectSeo } from "./seo.js";
|
|
20
21
|
import { generateSitemap } from "./sitemap.js";
|
|
@@ -92,6 +93,9 @@ export async function buildStaticSite(options) {
|
|
|
92
93
|
const externalized = externalizeSharedAssets(outDir);
|
|
93
94
|
if (externalized.assets > 0)
|
|
94
95
|
console.log(`[stx] externalized ${externalized.assets} asset(s) from ${externalized.pages} page(s) (${(externalized.bytesInlined / 1024).toFixed(1)}KB removed from HTML)`);
|
|
96
|
+
const repeated = externalizeRepeatedAssets(outDir);
|
|
97
|
+
if (repeated.assets > 0)
|
|
98
|
+
console.log(`[stx] externalized ${repeated.assets} repeated asset(s) from ${repeated.pages} page(s) (${(repeated.bytesInlined / 1024).toFixed(1)}KB removed from HTML)`);
|
|
95
99
|
if (existsSync(publicDir))
|
|
96
100
|
cpSync(publicDir, outDir, { recursive: !0 });
|
|
97
101
|
const conventionalAssets = resolveConventionalAssetRoot();
|