Rollup-plugin-vue: Duplicate helper functions: __vue_normalize__ & __vue_create_injector__

Created on 3 Jun 2018  路  4Comments  路  Source: vuejs/rollup-plugin-vue

use rollup-plugin-vue to transform app.vue:

<script>
import App2 from './app2.vue'
export default {
  render(h) {
    return h(App2)
  }
}
</script>

Expected behavior

function __vue_normalize__() {}
function __vue_create_injector__() {}

Actual behavior

function __vue_normalize__() {}
function __vue_create_injector__() {}
function __vue_normalize__$1() {}
function __vue_create_injector__$1() {}

Steps to reproduce the behavior

If a Vue component library has a large number of components, rollup is not that much cheaper than webpack.

Most helpful comment

@znck Please note that if option css: false was specified, dead code __vue_create_injector__ and __vue_create_injector_ssr__ were also generated. And please do not add arguments to function __vue_normalize__ if not needed, since optimization tools like uglify-es cannot remove dead code entirely.

All 4 comments

I already have this on my todo list. Expect a fix by this weekend.

@znck Please note that if option css: false was specified, dead code __vue_create_injector__ and __vue_create_injector_ssr__ were also generated. And please do not add arguments to function __vue_normalize__ if not needed, since optimization tools like uglify-es cannot remove dead code entirely.

@znck any updates on this? My UI library went from 15KB to 20KB after switching to v4. Thanks for a great plugin!

Version 4.4.0-alpha.0 is published with external assemble helpers.

Could you please try that? Waiting on feedback if this approach is helpful.

Was this page helpful?
0 / 5 - 0 ratings