Skip to content

Commit

Permalink
fix sandbox resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
louisgv committed May 15, 2024
1 parent 5d95bc9 commit 0bb797a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
19 changes: 15 additions & 4 deletions core/parcel-transformer-manifest/src/handle-sandboxes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,22 @@ export async function handleSandboxes() {
return
}

const srcPaths = ["sandboxes", "sandbox.ts", "sandbox.tsx", "sandbox.svelte"].map((file) =>
resolve(srcDir, file)
)
const srcPaths = [
"sandboxes",
"sandbox.ts",
"sandbox.tsx",
"sandbox.svelte",
"sandbox.vue"
].map((file) => resolve(srcDir, file))

const dotSandboxesDir = resolve(dotPlasmoDir, "sandboxes")

const [
srcSandboxesDirExists,
srcSandboxTsFileExists,
srcSandboxTsxFileExists,
srcSandboxSvelteFileExists,
srcSandboxVueFileExists,
dotSandboxesDirExists
] = await Promise.all(
[...srcPaths, dotSandboxesDir].map((p) => asset.fs.exists(p))
Expand All @@ -43,7 +49,12 @@ export async function handleSandboxes() {
}
}

const hasSandboxFile = srcSandboxTsFileExists || srcSandboxTsxFileExists
const hasSandboxFile =
srcSandboxTsFileExists ||
srcSandboxTsxFileExists ||
srcSandboxSvelteFileExists ||
srcSandboxVueFileExists

if (!hasSandboxFile && sandboxPages.length === 0) {
return
}
Expand Down
2 changes: 1 addition & 1 deletion examples

0 comments on commit 0bb797a

Please sign in to comment.