bun-plugin-stx 0.2.868 → 0.2.869

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.
@@ -2,7 +2,7 @@
2
2
  // src/index.ts
3
3
  import fs2 from "fs";
4
4
  import path2 from "path";
5
- import { buildWebComponents, cacheTemplate, checkCache, classifyAllScripts, defaultConfig, extractVariables, insertBeforeBodyClose, loadStxConfig, processClientScript, processDirectives, readMarkdownFile, withinBundlerCallback } from "@stacksjs/stx";
5
+ import { buildWebComponents, cacheTemplate, checkCache, classifyAllScripts, defaultConfig, extractVariables, findSfcTemplateBlock, insertBeforeBodyClose, loadStxConfig, processClientScript, processDirectives, readMarkdownFile, withinBundlerCallback } from "@stacksjs/stx";
6
6
 
7
7
  // src/watch.ts
8
8
  import fs from "fs";
@@ -390,9 +390,9 @@ export { content as default };
390
390
  }
391
391
  const content = await Bun.file(filePath).text();
392
392
  let workingContent = content;
393
- const templateTagMatch = content.match(/<template\b[^>]*>([\s\S]*?)<\/template>/i);
394
- if (templateTagMatch) {
395
- workingContent = templateTagMatch[1].trim();
393
+ const sfcTemplate = findSfcTemplateBlock(content);
394
+ if (sfcTemplate) {
395
+ workingContent = sfcTemplate.content.trim();
396
396
  }
397
397
  const classified = classifyAllScripts(content);
398
398
  const clientScripts = classified.client.map((s) => s.fullTag);
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  createRoute2,
9
9
  readMarkdownFile2,
10
10
  src_default
11
- } from "./chunk-xyc2ydbw.js";
11
+ } from "./chunk-2yd1k63g.js";
12
12
  export {
13
13
  createMiddleware2 as createMiddleware,
14
14
  createRoute2 as createRoute,
package/dist/preload.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  src_default
4
- } from "./chunk-xyc2ydbw.js";
4
+ } from "./chunk-2yd1k63g.js";
5
5
 
6
6
  // src/preload.ts
7
7
  var {plugin } = globalThis.Bun;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bun-plugin-stx",
3
3
  "type": "module",
4
- "version": "0.2.868",
4
+ "version": "0.2.869",
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.868",
78
- "stx-router": "0.2.868"
77
+ "@stacksjs/stx": "0.2.869",
78
+ "stx-router": "0.2.869"
79
79
  }
80
80
  }