-
Notifications
You must be signed in to change notification settings - Fork 4
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
Bundle external dependency instead of treating it as external #91
Comments
thank you for the issue @marcuslindblom, but I don't think any of the other JS bundler packages/bundles a URL import. For your use case, since you've import confetti from 'canvas-confetti'; |
Tried that one also but the output is just import"canvas-confetti";var o=()=>{console.log("Hello, world.")};export{o as hello}; Maybe it's important to tell you that my target is the browser and plain vanilla js in an es module. |
with the import changed to Please note that, If you really want to bundle |
Ah cool, that was the issue. Using Thanks 🙏 |
Opening this issue again. I'm using klap only to build my production package so for development I'm using imports like this For production I would like Klap to bundle the external libraries and it's not an option to use |
Without changing the import to Can you speak more about your workflow? One way to resolve this is to add a CDN plugin, which downloads the file when building for production and just ignore the urls when building for development. |
My workflow is pretty simple. My project use vanilla js with es modules. In production I bundle all my modules into a single file. I have two external dependencies that I would like to bundle because CDNs harm the performance of my app. A CDN plugin would work but maybe it's better to just download the scripts and put them in a lib folder. Seems like the easiest way atm :) |
Great, that helps. If it's not too much to ask, can you create a smallest reproduction for this workflow, or perhaps point me to existing project? |
🎉 This issue has been resolved in version 6.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
@marcuslindblom Let me know if you notice any issues with this feature. |
@osdevisnot I just tried the new release and it fails with this exception.
This is a vanilla js project with es modules only |
This is strange. What version of klap are you upgrading from? Also, can you please add a dependency on |
I'm using 6.0.9 atm |
@marcuslindblom the latest version should fix this issue. Can you point me yo your repository if this is not the case? |
Using this simple example:
I have tried to install the package using
yarn add canvas-confetti
but it's still treated as external when i runnpx klap build
The text was updated successfully, but these errors were encountered: