fix(plugin-vue): allow overwrite esbuild config #444
Merged
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
fix(plugin-vue): Support decorators in .vue file.
issues: #430
More thoughts:
in vite-plugin-vue,There is no merge from esbuildTransformOptions, so submit the modification and merge esbuildTransformOptions, that is, options.devServer?.config.esbuild in the development environment
in vite vite:esbuild,Merged from esbuildTransformOptions
Just for fault tolerance and compatibility considerations
vite is the basic component of vite-plugin-vue. When vite-plugin-vue calls the transformWithEsbuild function provided by vite:esbuild in the vite project, should it be consistent with the parameters of vite:esbuild calling transformWithEsbuild, that is, esbuildTransformOptions, that is, options.devServer?.config.esbuild in the development environment
Because the running results of vite in the development environment and the production environment should be consistent, it is also necessary to keep it consistent with the parameters passed in when vite:esbuild calls the transformWithEsbuild function
This code will only be triggered in the development environment, so it is correct to use options.devServer?.config.esbuild