Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

Commit 7c0fd3e

Browse files
committed
fix: tolerant erros for plugins, close #16
1 parent af118b2 commit 7c0fd3e

File tree

3 files changed

+23
-18
lines changed

3 files changed

+23
-18
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
"@antfu/utils": "^0.2.4",
7070
"@types/jest": "^27.0.1",
7171
"@types/node": "^16.7.1",
72-
"@vue/composition-api": "^1.1.1",
72+
"@vue/composition-api": "^1.1.3",
7373
"@vue/runtime-dom": "^3.2.4",
7474
"bumpp": "^6.0.6",
7575
"eslint": "^7.32.0",
@@ -92,6 +92,6 @@
9292
"@vue/shared": "^3.2.4",
9393
"htmlparser2": "^6.1.0",
9494
"magic-string": "^0.25.7",
95-
"unplugin": "^0.0.6"
95+
"unplugin": "^0.0.8"
9696
}
9797
}

pnpm-lock.yaml

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/unplugin.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ export default createUnplugin<ScriptSetupTransformOptions>(options => ({
1111
return id.endsWith('.vue')
1212
},
1313
transform(code, id) {
14-
if (scriptSetupRE.test(code))
15-
return transform(code, id, options)
14+
try {
15+
if (scriptSetupRE.test(code))
16+
return transform(code, id, options)
17+
}
18+
catch (e) {
19+
this.error(e)
20+
}
1621
},
1722
}))

0 commit comments

Comments
 (0)