vuejs / rollup-plugin-vue

Roll .vue files
https://vuejs.github.io/rollup-plugin-vue
MIT License
846 stars 148 forks source link

index.esm.js generates incorrect vue import #428

Closed pancake-boy closed 3 years ago

pancake-boy commented 3 years ago

Version

5.0.0

Reproduction link

https://github.com/pancake-boy/rollup-vue-example

Steps to reproduce

https://github.com/pancake-boy/rollup-vue-example

npm run build

index.esm.js contains:

import Vue, { resolveComponent, openBlock, createBlock, createVNode, toDisplayString, withCtx, mergeProps, toHandlers, pushScopeId, popScopeId, createCommentVNode, renderSlot, withScopeId, createTextVNode, Fragment, renderList } from 'vue';

when i npm install the package, i get warnings like "export 'Fragment' was not found in 'vue'

and from chrome console: Uncaught TypeError: Object(...) is not a function at eval (index.esm.js?b60c:87) at Module../node_modules/@test/common-ui/lib/index.esm.js (chunk-vendors.js:263) at __webpack_require__ (app.js:849)

What is expected?

import Vue from 'vue'

What is actually happening?

import Vue, { resolveComponent, openBlock, createBlock, createVNode, toDisplayString, withCtx, mergeProps, toHandlers, pushScopeId, popScopeId, createCommentVNode, renderSlot, withScopeId, createTextVNode, Fragment, renderList } from 'vue';

pancake-boy commented 3 years ago

downgraded to v5 and its working