We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 13d41d8 commit 43150e3Copy full SHA for 43150e3
packages/plugin-legacy/index.js
@@ -533,17 +533,13 @@ function isLegacyOutput(options) {
533
function recordAndRemovePolyfillBabelPlugin(polyfills) {
534
return ({ types: t }) => ({
535
name: 'vite-remove-polyfill-import',
536
- visitor: {
537
- Program: {
538
- exit(path) {
539
- path.get('body').forEach((p) => {
540
- if (t.isImportDeclaration(p)) {
541
- polyfills.add(p.node.source.value)
542
- p.remove()
543
- }
544
- })
+ post({ path }) {
+ path.get('body').forEach((p) => {
+ if (t.isImportDeclaration(p)) {
+ polyfills.add(p.node.source.value)
+ p.remove()
545
}
546
+ })
547
548
})
549
0 commit comments