developit / microbundle

📦 Zero-configuration bundler for tiny modules.
https://npm.im/microbundle
MIT License
8k stars 361 forks source link

Question: #1005

Closed arjun292619 closed 1 year ago

arjun292619 commented 1 year ago

Hello, I am new to Microbundle and I am not sure if this is the right place. We are using Microbundle as bundler for publishing our components. If we use lazyloading or dynamic imports. I get a rollup error. Basically asking me configure the output: [ { file: 'bundle.js', format: 'cjs' } to output: [ { dir:'/path" file: 'bundle.js', format: 'cjs' }. How can I enable Microbundle to use lazyloading & dynamic imports

rschristian commented 1 year ago

Please show your component code. Dynamic imports should work out-of-the-box.

It doesn't make much sense to lazy load while building a package though. I'd say lazy load the built components in your app, don't lazy load parts of the components while trying to bundle them.

rschristian commented 1 year ago

Feel free to comment and we can reopen if you're still having issues.