@stacksjs/stx 0.2.193 → 0.2.194

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.d.ts CHANGED
@@ -23,6 +23,7 @@ export { type BuildResult } from './build-optimizer';
23
23
  // Exported for servers as well as the static build: SSR inlines the runtime
24
24
  // once per *request*, which is the same waste in a worse form.
25
25
  export { EXTERNALIZED_ASSET_DIR, externalizeHtml, externalizeSharedAssets, type ExternalizedAsset, type ExternalizeHtmlResult, type ExternalizeResult } from './build-externalize';
26
+ export { externalizeRepeatedAssets } from './build-externalize-repeated';
26
27
  export { type ComponentInstance } from './reactivity';
27
28
  export { type HydrationOptions } from './hydration';
28
29
  // `CookieOptions` is the user-facing type for the `useCookie()` composable —
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export { EXTERNALIZED_ASSET_DIR, externalizeHtml, externalizeSharedAssets } from "./build-externalize.js";
2
+ export { externalizeRepeatedAssets } from "./build-externalize-repeated.js";
2
3
  export {
3
4
  clearStorage,
4
5
  getStorageKeys,
@@ -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();