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

When using @rollup/plugin-babel, there might be issues with the generated code order #15425

Closed
7 tasks done
Lpmvb opened this issue Dec 25, 2023 · 2 comments
Closed
7 tasks done

Comments

@Lpmvb
Copy link

Lpmvb commented Dec 25, 2023

Describe the bug

image
The declaration and usage order of variables is incorrect in the generated code when using the above configuration for polyfill during bundling.
image

image

Reproduction

https://stackblitz.com/edit/vitejs-vite-lpqcmx?file=dist%2Fvite-starter.iife.js

Steps to reproduce

  1. pnpm i
  2. pnpm build
  3. view dist/vite-starter.iife.js

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.18.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 9.4.2 - /usr/local/bin/npm
    pnpm: 8.10.5 - /usr/local/bin/pnpm
  npmPackages:
    vite: ^5.0.8 => 5.0.10

Used Package Manager

pnpm

Logs

No response

Validations

Copy link

stackblitz bot commented Dec 25, 2023

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@Lpmvb
Copy link
Author

Lpmvb commented Dec 25, 2023

If I move the configuration options to the Vite plugins, it works correctly, but it doesn't handle polyfill in .vue files.

@Lpmvb Lpmvb closed this as completed Dec 27, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jan 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant