-
-
Notifications
You must be signed in to change notification settings - Fork 179
Closed as not planned
Labels
duplicateThis issue or pull request already existsThis issue or pull request already exists
Description
Related plugins
Description
我们的业务有Chrome69的运行场景,在使用Vite的过程中,我们发现生产环境构建出来的代码可以在Chrome69下正常运行,但是dev环境下无法运行。我们尝试使用vite.config.js配置中的esbuild.target来指定执行编译的目标环境,但是通过阅读源码发现这个配置只能修改Vite在编译js,ts等文件才会生效,而.vue文件是通过vite-plugin-vue编译的,并且在调用esbuild的时候是写死了配置(
const { code, map } = await transformWithEsbuild( |
Suggested solution
希望vite-plugin-vue 在dev环境下调用esbuild配置的时候,可以merge从vite.config.js传入的esbuild配置或者由用户可以手动传入。
Alternative
目前我们的解决方案是单独再写了一个插件,在vue插件执行完成之后,再调用一次esbuild处理.vue文件,使得可以编译到较低的JavaScript版本,但这样会导致一个文件需要重复编译两次,有一定性能损耗。因此仍希望官方可以支持esbuild配置传入,使得开发者可以自己选择是否需要编译到较低的语法版本,当然这可能会增加编译时间,但可以把这个决定权交给开发者。
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Metadata
Metadata
Assignees
Labels
duplicateThis issue or pull request already existsThis issue or pull request already exists