-
Notifications
You must be signed in to change notification settings - Fork 136
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Environment
node: 20
unplugin: 2.3.5
Reproduction
https://github.com/BoYuanSu/unplugin-unused-components/tree/fix/esbuild-test
-
install deps,
pnpm i
. -
change directory to esbuild-plugin-test
cd ./tests/esbuild-plugin-test/
. -
run test script
pnpm run test
.
Describe the bug
I'm developing a custom plugin based on unplugin
, designed to scan my project for components and report unused ones. It works as expected in vite
and webpack
, but when I try to test it with esbuild
, I encounter the following error:
stdout | esbuild.test.ts > esbuild > should run esbuild tests
Found 2 unused components:
- /Users/user/Desktop/boyuansu/unplugin-unused-components/tests/fixtures/TestUnused.vue
- /Users/user/Desktop/boyuansu/unplugin-unused-components/tests/fixtures/TestUnusedReact.jsx
❯ esbuild.test.ts (1 test | 1 failed) 60ms
× esbuild > should run esbuild tests 59ms
→ Build failed with 2 errors:
../fixtures/TestUsed.vue:1:0: ERROR: The JSX syntax extension is not currently enabled
../fixtures/TestUsed.vue:4:10: ERROR: Expected "}" but found "{"
I've tried to remove my custom plugin and the fixtures setup work fine with esbuild config.
Is there anything specific I need to do to support esbuild with unplugin?
Any known caveats or extra config I might be missing?
Thanks!
Additional context
No response
Logs
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working