Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(plugin-vue): Support decorators in .vue file.
issues: vitejs#430 More thoughts: So should we not hard-code loader:'ts' and target:'es2020; { target: 'esnext', // vitejs#430 Support decorators in .vue file. vitejs#430 // target can be overridden by esbuild config target ...options.devServer?.config.esbuild, loader: 'ts', sourcemap: options.sourceMap, }, 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 transformWithEsbuild( resolvedCode, filename, options.devServer?.config.esbuild || {}, resolvedMap, ) 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
- Loading branch information