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
Legacy build fails on babel step #2442
Comments
Removing the |
same problem |
As a temporary workaround you can pin the
|
I had the same problem. my vite.config.ts file import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
import legacy from '@vitejs/plugin-legacy'
export default defineConfig({
plugins: [
vue(),
legacy({
targets: ['defaults', 'not IE 11']
})
],
resolve: {
alias: {
'@': path.resolve(__dirname, './src')
}
},
build: {
outDir: "./www",
}
}) |
For those using
|
+1 having the same issue. @mengelbrecht 's workaround helped for now #2442 (comment) |
+1 having the same issue. @wgordon17 's workaround helped for now #2442(comment) |
so.. I use pnpm, it seems to have no effect. |
@vvni forn pnpm you should use a module.exports = {
hooks: {
readPackage: (pkg) => {
if (pkg.name === "@vitejs/plugin-legacy") {
pkg.dependencies['@babel/standalone'] = '7.13.9';
}
return pkg;
}
}
}; |
thanks! |
Is any progress there? |
Any progress? |
@zheeeng @ShookLyngs You may waiting for PR from either babel/babel#13017 or rollup/plugins#838 . |
@babel/standalone@7.13.12 has been published, RE-install vite-legacy can fix this issue. yarn remove @vitejs/plugin-legacy && yarn add @vitejs/plugin-legacy --dev |
@pedrodim could you confirm that this issue has been fixed after @babel/standalone@7.13.12? |
Yes! Issue is fixed with @babel/standalone@7.13.12. It would be great if the plugin's package.json would be updated with the updated @babel/standalone version number, but not necessary as it picks already the correct version as it is thanks to semver npm uninstall @babel/standalone @vitejs/plugin-legacy && npm install @vitejs/plugin-legacy -D |
@pedrodim would you like to send a PR for that? |
Describe the bug
The build with the legacy plugin active fails with an error from babel.
Reproduction
Base config
System Info
vite
version: 2.0.5The text was updated successfully, but these errors were encountered: