-
Notifications
You must be signed in to change notification settings - Fork 362
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
How to include dependencies in bundle? #633
Comments
@Deliaz Can you share a repo or a codesandbox where it's not working out for you? |
@Deliaz it's likely that you have these installed as To inline dependencies, declare them as {
"scripts": {
"build": "microbundle"
},
"devDependencies": {
// these will be inlined into the bundle
"some-lib": "^1.0.0",
"another-lib": "^2.0.0",
"microbundle": "^12.0.0"
},
"dependencies": {
// this will be kept as an external dependency require()'d by the bundle:
"external-thing": "^1.2.3"
}
} |
@developit Thanks! That answered my question and solved the case. |
Ah! Yes it would. I'll add that. Update - looks like we have #454 to track. |
Wouldn't it make sense to exclude |
@rchrd2 For browsers dependency resolution currently only works via relative or absolute url paths. There is the import map spec to specify resolution of ids like |
@marvinhagemeister I guess @rchrd2 didn't mean to refer to any browser-side dependency loading mechanism, but instead meant that it would make sense to have That's basically what I've been looking at this myself for the last few hours, and I'm kinda lost actually, since Edit: it is actually called, but only if |
Yes - microbundle's external is different than Rollup's. |
I'm still confused about how to generate a standalone umd bundle which works in an html Did you solve this @olance? |
By default, Microbundle leaves any modules listed in If you want a stand-alone bundle, use |
@rschristian legend. This solved it for me 🙏 Is there a reason the UMD build does not do |
Fundamentally, In Node, this means they will be installed when installing your module. In a browser context, this means they'll need to be available on the page. Microbundle sees this intention and will therefore not inline them.
Not at all. If your module relies on (say) |
It is a quite simple question, but it seems I missed an explanation.
How to build a bundle which includes all packages I
import
in my future lib? All I can see that my dist files try torequire
orinclude
them, but do not include any third-party code.The text was updated successfully, but these errors were encountered: