Skip to content

Commit

Permalink
Update handle-sandboxes.ts (#977)
Browse files Browse the repository at this point in the history
* Update handle-sandboxes.ts

Added Svelte support

Signed-off-by: avi12 <avi6106@gmail.com>

* fix sandbox resolve

* bump patch

---------

Signed-off-by: avi12 <avi6106@gmail.com>
Co-authored-by: L❤️ ☮️ ✋ <6723574+louisgv@users.noreply.github.com>
  • Loading branch information
avi12 and louisgv authored May 15, 2024
1 parent cb01811 commit 287654d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion core/parcel-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@plasmohq/parcel-config",
"version": "0.40.7",
"version": "0.40.8",
"license": "MIT",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion core/parcel-transformer-manifest/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@plasmohq/parcel-transformer-manifest",
"version": "0.18.0",
"version": "0.19.0",
"description": "Plasmo Parcel Transformer for Web Extension Manifest",
"files": [
"dist",
Expand Down
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"].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 287654d

Please sign in to comment.