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(plugin-vue): allow overwrite esbuild config #444

Merged

Commits on Sep 15, 2024

  1. 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
    alamhubb committed Sep 15, 2024
    Configuration menu
    Copy the full SHA
    982ee0e View commit details
    Browse the repository at this point in the history

Commits on Sep 16, 2024

  1. chore: clean

    sxzz committed Sep 16, 2024
    Configuration menu
    Copy the full SHA
    222965c View commit details
    Browse the repository at this point in the history