bun-plugin-stx 0.2.6 → 0.2.9
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/{chunk-j0k3wkwg.js → chunk-a3qganyh.js} +13 -1
- package/dist/chunk-fj6fej0j.js +12771 -0
- package/dist/client.js +1 -1
- package/dist/index.js +2 -2
- package/dist/preload.js +2 -2
- package/dist/serve.d.ts +3 -0
- package/dist/serve.js +57 -18
- package/package.json +7 -2
- /package/dist/{chunk-eecw9x2f.js → chunk-2mx7fq49.js} +0 -0
|
@@ -282,6 +282,18 @@ function stxPlugin(userOptions) {
|
|
|
282
282
|
...userOptions
|
|
283
283
|
};
|
|
284
284
|
const allDependencies = new Set;
|
|
285
|
+
if (!build.config.root && build.config.entrypoints?.length) {
|
|
286
|
+
const dirs = build.config.entrypoints.map((e) => path2.dirname(path2.resolve(e)));
|
|
287
|
+
const commonRoot = dirs.reduce((a, b) => {
|
|
288
|
+
const aParts = a.split(path2.sep);
|
|
289
|
+
const bParts = b.split(path2.sep);
|
|
290
|
+
let i = 0;
|
|
291
|
+
while (i < aParts.length && i < bParts.length && aParts[i] === bParts[i])
|
|
292
|
+
i++;
|
|
293
|
+
return aParts.slice(0, i).join(path2.sep);
|
|
294
|
+
});
|
|
295
|
+
build.config.root = commonRoot;
|
|
296
|
+
}
|
|
285
297
|
const webComponentsPath = options.webComponents?.enabled ? `./${path2.relative(path2.dirname(build.config?.outdir || "dist"), options.webComponents.outputDir || "dist/web-components")}` : "/web-components";
|
|
286
298
|
const builtComponents = [];
|
|
287
299
|
if (options.webComponents?.enabled) {
|
|
@@ -374,7 +386,7 @@ export { content as default };
|
|
|
374
386
|
const serverScripts = [];
|
|
375
387
|
const signalsScripts = [];
|
|
376
388
|
let scriptMatch;
|
|
377
|
-
const usesSignalsAPI = (content2) => /\b(?:state|derived|effect|batch)\s*\(/.test(content2);
|
|
389
|
+
const usesSignalsAPI = (content2) => /\b(?:state|derived|effect|batch|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/.test(content2);
|
|
378
390
|
while ((scriptMatch = scriptRegex.exec(content)) !== null) {
|
|
379
391
|
const attrs = scriptMatch[1];
|
|
380
392
|
const scriptContent = scriptMatch[2];
|