-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Using "bundler" build with compiler (vue.esm-bundler.js) with webpack in "production" mode includes @babel/parser in final bundle #2515
Comments
it seems the same as #2258 |
Is there any workaround to solve this issue or we need to wait till next build of Vue? |
This issue is just mentioned in #2513 , But is there a workaround to fix this issue? |
Watching this one keenly, for a project I am conducting we have no choice but to compile some templates on the fly. I'm aware there was an entire re-write between Vue 2 and Vue 3 but using the equivalent version of Vue does not drag in the entire babel parser library so I'm hopeful a resolution can be found for Vue 3.... otherwise performance wise I'm in trouble if not before we need to go to production. |
Version
3.0.2
Reproduction link
https://github.com/Liwoj/vue3-with-compiler
Steps to reproduce
build
command inpackage.json
by adding--report
vue.config.js
and enable runtime compilation -runtimeCompiler: true
(which switches vue alias tovue.esm-bundler.js
)yarn build
dist\report.html
What is expected?
"vendors" bundle should not include
@babel/parser
package (230 KB)What is actually happening?
@babel/parser
is part of the production bundle...As anything from @babel/parser is not included in browser compiler builds of Vue (
vue.esm-browser.js
for example), it should not be included when used with bundler buildI'm not an expert on Vue 3 codebase but it seems problem is in the https://github.com/vuejs/vue-next/blob/master/packages/compiler-core/src/transforms/transformExpression.ts#L90
processExpression
functionSame code in
@vue/compiler-core/dist/compiler-core.esm-bundler.js
(NPM package)...the code which is intended to run in the browser is used ONLY in DEV build and eliminated in production build which leaves the rest of the
processExpression
function (which is using @babel/parser) in the bundleThe text was updated successfully, but these errors were encountered: