Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow scan to use user provided loaders #1884

Closed
wants to merge 2 commits into from
Closed

fix: allow scan to use user provided loaders #1884

wants to merge 2 commits into from

Conversation

pengx17
Copy link
Contributor

@pengx17 pengx17 commented Feb 5, 2021

If the user js sources have jsx syntaxes, but the file extension ends with js, he may want to force esbuild to use "jsx/tsx" loaders in the vite.config.js.
However, during the dep scan phase, the esbuildScanPlugin will fail because esbuild will complain that js contains jsx tags.
This fix will force the esbuild to use user-provided loader configs during dep scan phase to mitage this issue.

packages/vite/src/node/optimizer/scan.ts Show resolved Hide resolved
packages/vite/src/node/optimizer/scan.ts Show resolved Hide resolved
packages/vite/src/node/optimizer/scan.ts Outdated Show resolved Hide resolved
packages/vite/src/node/optimizer/scan.ts Outdated Show resolved Hide resolved
packages/vite/src/node/optimizer/scan.ts Outdated Show resolved Hide resolved
@Shinigami92 Shinigami92 added p2-nice-to-have Not breaking anything but nice to have (priority) 🔍 review needed labels Mar 23, 2021
@Shinigami92
Copy link
Member

@matias-capeletto This may or may not be bumped up to p3-minor-bug

@diogob
Copy link

diogob commented Apr 20, 2021

Considering this twitter thread is there any chance this will get merged?

@nihalgonsalves
Copy link
Member

JSX in JS is not recommended by Vite and won't be supported natively, but you can now use an esbuild plugin to specify your own loaders: #2991, released in v2.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p2-nice-to-have Not breaking anything but nice to have (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants