-
Notifications
You must be signed in to change notification settings - Fork 361
Wrong "import" in UMD bundle of UMD package #1064
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
Comments
That shouldn't be an issue, so long as Are you importing |
Sorry, my bad. I should have posted it right away.
Reproduction is basically this: <script src="./dist/index.umd.js"></script>
<script>
var configuration = { searchableFields: ['name'] };
var rows = [{ name: 'name' }];
itemsjs(rows, configuration);
</script> And error in console is
|
You don't load any of the dependencies, Did you intend to inline all deps into your bundle? If so, you can set |
Oh. I didn't realized that. Thank you. I will try it |
Just to clarify, in UMD, dependencies are expected to exist on the global -- <script src="./lunr.js"></script>
<script src="./my-lib.js"></script> And so on for every dep. this allows them to attach to the global, and your script to access them after they've done so.
|
Yeah I got it. Thanks. As soon as you wrote, about dependencies it all clicked. It totally makes sense, I just haven't thought of it earlier |
Everything works as expected. Thank you for the help |
Glad to hear it! Let me know if you run into any further issues. |
I converted
itemsjs
to ES modules and use microbundle to bundle it for npm. ES bundle works ok. But umd bundle throws an errorI checked generated UMD, it seems
u.default
is referring tolunr
. lunr itself is published as UMD. I guess this is an issue, but hard to tellRelated: itemsapi/itemsjs#135
The text was updated successfully, but these errors were encountered: