Skip to content
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

when the build esm format file, Vue will be packaged as default export #273

Open
ShetePro opened this issue Oct 30, 2024 · 6 comments
Open

Comments

@ShetePro
Copy link

First check https://github.com/SortableJS/Vue.Draggable/blob/master/CONTRIBUTING.md

Step by step scenario

When I use the plugin to package in esm format,The packaging result will contain import require$$0, { ... } from "vue";
Vue3x has no default export,This will cause a runtime error

Actual Solution

image

Expected Solution

not error

@ShetePro
Copy link
Author

If use umd file, There will not be this problem.

@ShetePro
Copy link
Author

image Setting vue as an external dependency can solve this problem, but I don't know if there will be any other impact?

@lzl19971215
Copy link

+1 same problem when using vite, got error:
No matching export in "node_modules/vue/dist/vue.runtime.esm-bundler.js" for import "default"

The compiled js file contains import _n, { ... } from "vue";

@XiaoDan12202
Copy link

+1 same problem

@Sky-Young
Copy link

Sky-Young commented Dec 16, 2024

vite.config.js add build config

build: { commonjsOptions: { esmExternals: true } }

@zhuanglinxin
Copy link

vite.config.js add build config

build: { commonjsOptions: { esmExternals: true } }

thank you for you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants