[Vuejs]-Vue 3 vendor bundle is bloated with @babel/parser/lib when vue.esm-bundler.js is used in webpack

0👍

I strongly believe it is a bug in Vue 3 so I submitted a bug report – you can track it here

…I reproduced it myself using Vue CLI just to eliminate the chance the problem is in your Webpack config

You have 2 options to workaround this issue:

  1. If you don’t need to release right now, just work on your project and wait for a fix (I’m pretty sure it will be fixed – Vue builds for a browser which include compiler does not depend on @babel/parser so it’s clear Vue don’t need it to work correctly inside browser)
  2. Don’t use in-DOM templates and template option (string templates) – put everything in .vue files, <template></template> blocks – Runtime + Compiler vs. Runtime-only. Then you don’t need a build with compiler…

EDIT: removed the part about missing process.env.NODE_ENV as --mode param to Webpack CLI does exactly that…

Leave a comment