-
-
Notifications
You must be signed in to change notification settings - Fork 152
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
dev模式下,调用esbuild构建时的配置是否可以从vite.config.js同步读取或者支持参数传入? #278
Labels
duplicate
This issue or pull request already exists
Comments
实际上问题出在:
当 .vue 文件中 当 应该废弃内联代码,使其保持一致性:PR #222 。 |
Duplicate of #31 |
sapphi-red
added
duplicate
This issue or pull request already exists
and removed
enhancement: pending triage
labels
Feb 27, 2024
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Related plugins
plugin-vue
plugin-vue-jsx
Description
我们的业务有Chrome69的运行场景,在使用Vite的过程中,我们发现生产环境构建出来的代码可以在Chrome69下正常运行,但是dev环境下无法运行。我们尝试使用vite.config.js配置中的esbuild.target来指定执行编译的目标环境,但是通过阅读源码发现这个配置只能修改Vite在编译js,ts等文件才会生效,而.vue文件是通过vite-plugin-vue编译的,并且在调用esbuild的时候是写死了配置(
vite-plugin-vue/packages/plugin-vue/src/main.ts
Line 233 in 7d52e61
Suggested solution
希望vite-plugin-vue 在dev环境下调用esbuild配置的时候,可以merge从vite.config.js传入的esbuild配置或者由用户可以手动传入。
Alternative
目前我们的解决方案是单独再写了一个插件,在vue插件执行完成之后,再调用一次esbuild处理.vue文件,使得可以编译到较低的JavaScript版本,但这样会导致一个文件需要重复编译两次,有一定性能损耗。因此仍希望官方可以支持esbuild配置传入,使得开发者可以自己选择是否需要编译到较低的语法版本,当然这可能会增加编译时间,但可以把这个决定权交给开发者。
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: