bun-plugin-stx 0.2.109 → 0.2.111
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/serve.js +4 -3
- package/package.json +1 -1
package/dist/serve.js
CHANGED
|
@@ -8702,6 +8702,7 @@ var defaultGeneratedDir4 = resolve12(process20.cwd(), "src/generated");
|
|
|
8702
8702
|
// src/serve.ts
|
|
8703
8703
|
import { stateDir, stateDirName } from "@stacksjs/stx";
|
|
8704
8704
|
var defaultStxModule = import("@stacksjs/stx");
|
|
8705
|
+
var REACTIVE_TEMPLATE_DIRECTIVE_RE = /@for|:for|@if|:if|@else|:else|x-for|x-if|x-else/;
|
|
8705
8706
|
function buildDynamicRouteRegexes(fileRouteBase) {
|
|
8706
8707
|
const toPattern = (p) => p.replace(/\[([^\]]+)\]/g, "([^/]+)").replace(/\//g, "\\/");
|
|
8707
8708
|
const patterns = [new RegExp(`^${toPattern(fileRouteBase)}$`)];
|
|
@@ -9518,8 +9519,8 @@ After installing: bun add bun-plugin-stx`);
|
|
|
9518
9519
|
const dependencies = new Set;
|
|
9519
9520
|
output = await processDirectives(output, context, filePath, config5, dependencies);
|
|
9520
9521
|
output = await injectRouterScript(output, getRouterInjectOptions());
|
|
9521
|
-
const directiveTemplateRe =
|
|
9522
|
-
const hasDirectiveTemplates =
|
|
9522
|
+
const directiveTemplateRe = REACTIVE_TEMPLATE_DIRECTIVE_RE;
|
|
9523
|
+
const hasDirectiveTemplates = new RegExp(`<template\\s[^>]*(?:${REACTIVE_TEMPLATE_DIRECTIVE_RE.source})`).test(output);
|
|
9523
9524
|
if (hasDirectiveTemplates) {
|
|
9524
9525
|
output = output.replace(/<template(?:\s[^>]*)?>|<\/template>/gi, (match) => {
|
|
9525
9526
|
if (directiveTemplateRe.test(match))
|
|
@@ -9702,7 +9703,7 @@ ${output}`;
|
|
|
9702
9703
|
}
|
|
9703
9704
|
}
|
|
9704
9705
|
output = await injectRouter(output, getRouterInjectOptions());
|
|
9705
|
-
const directiveTemplateRe2 =
|
|
9706
|
+
const directiveTemplateRe2 = REACTIVE_TEMPLATE_DIRECTIVE_RE;
|
|
9706
9707
|
output = output.replace(/<template(?:\s[^>]*)?>|<\/template>/gi, (match) => {
|
|
9707
9708
|
if (directiveTemplateRe2.test(match))
|
|
9708
9709
|
return match;
|
package/package.json
CHANGED