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

vite-plugin-legacy ignoreBrowserslistConfig option not working #10916

Closed
7 tasks done
hemengke1997 opened this issue Nov 14, 2022 · 1 comment
Closed
7 tasks done

vite-plugin-legacy ignoreBrowserslistConfig option not working #10916

hemengke1997 opened this issue Nov 14, 2022 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@hemengke1997
Copy link
Contributor

hemengke1997 commented Nov 14, 2022

Describe the bug

babel detect browerslist config when ignoreBrowerslistConfig and no targets:
https://github.com/babel/babel/blob/HEAD/packages/babel-helper-compilation-targets/src/index.ts#L197-L198

But, vite-plugin-legacy set targets: 'defaults' when not targets option in:
https://github.com/vitejs/vite/blob/HEAD/packages/plugin-legacy/src/index.ts#L122-L123

So, ignoreBrowserslistConfig made no sence. This is the FIRST.

Then, I developed vite-plugin-legacy locally, set targets to options.targets here:
https://github.com/vitejs/vite/blob/HEAD/packages/plugin-legacy/src/index.ts#L433-L434

and debug build with:

legacy({
  renderLegacyChunks: true,
  polyfills: true,
  ignoreBrowserslistConfig: false,
}),

then I found that babel can't detect browserslist config. I don't know whose problem this is.
image

Reproduction

https://github.com/hemengke1997/vpl-ignoreBrowerslist-repro

Steps to reproduce

  1. build with ignoreBrowerslist: true, then check the size of dist
  2. build with ignoreBrowerslist: true, the size is the same

System Info

System:
    OS: Windows 10 10.0.22000
    CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12700KF
    Memory: 16.72 GB / 31.82 GB
  npmPackages:
    @vitejs/plugin-legacy: ^2.3.1 => 2.3.1
    @vitejs/plugin-react: ^2.2.0 => 2.2.0
    vite: ^3.2.3 => 3.2.3

Used Package Manager

pnpm

Logs

No response

Validations

@sapphi-red
Copy link
Member

Closing as a duplicate of #2476

@sapphi-red sapphi-red closed this as not planned Won't fix, can't repro, duplicate, stale Nov 14, 2022
@sapphi-red sapphi-red added duplicate This issue or pull request already exists and removed pending triage labels Nov 14, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Nov 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants