bun-plugin-stx 0.2.914 → 0.2.917

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.
Files changed (2) hide show
  1. package/dist/serve.js +13 -1
  2. package/package.json +3 -3
package/dist/serve.js CHANGED
@@ -10848,6 +10848,7 @@ function __stxOverlay(errs){
10848
10848
  ...partialsDir && { partialsDir },
10849
10849
  autoShell: true,
10850
10850
  buildMode: "serve",
10851
+ inlineGeneratedCssBytes: stxConfig.inlineGeneratedCssBytes,
10851
10852
  ssr: stxConfig.ssr ?? defaultStxConfig.ssr ?? true,
10852
10853
  app: stxConfig.app || {},
10853
10854
  runtimeConfig: stxConfig.runtimeConfig,
@@ -11076,6 +11077,7 @@ function __stxOverlay(errs){
11076
11077
  ...partialsDir && { partialsDir },
11077
11078
  autoShell: true,
11078
11079
  buildMode: "serve",
11080
+ inlineGeneratedCssBytes: stxConfig.inlineGeneratedCssBytes,
11079
11081
  ssr: stxConfig.ssr ?? defaultStxConfig.ssr ?? true,
11080
11082
  app: stxConfig.app || {},
11081
11083
  runtimeConfig: stxConfig.runtimeConfig,
@@ -12120,7 +12122,17 @@ ${trailingPageScripts.join(`
12120
12122
  if (options.onResponse) {
12121
12123
  const hooked = await options.onResponse(req, _finalResp);
12122
12124
  if (hooked instanceof Response)
12123
- return hooked;
12125
+ _finalResp = hooked;
12126
+ }
12127
+ if (stxConfig.deferScripts && req.method !== "HEAD" && _finalResp.body && !_finalResp.bodyUsed && _finalResp.headers.get("content-type")?.includes("text/html") && !_finalResp.headers.has("content-encoding")) {
12128
+ const stx = await stxModule;
12129
+ const headers = new Headers(_finalResp.headers);
12130
+ headers.delete("content-length");
12131
+ _finalResp = new Response(stx.prepareServePageAssets(await _finalResp.text()), {
12132
+ status: _finalResp.status,
12133
+ statusText: _finalResp.statusText,
12134
+ headers
12135
+ });
12124
12136
  }
12125
12137
  return _finalResp;
12126
12138
  })());
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bun-plugin-stx",
3
3
  "type": "module",
4
- "version": "0.2.914",
4
+ "version": "0.2.917",
5
5
  "description": "A Bun plugin that allows for using Laravel Blade-like syntax.",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",
@@ -74,7 +74,7 @@
74
74
  "typecheck": "bun tsc --noEmit"
75
75
  },
76
76
  "dependencies": {
77
- "@stacksjs/stx": "0.2.914",
78
- "stx-router": "0.2.914"
77
+ "@stacksjs/stx": "0.2.917",
78
+ "stx-router": "0.2.917"
79
79
  }
80
80
  }