cramforce / splittable

Module bundler with support for code splitting, ES6 & CommonJS modules.
Apache License 2.0
945 stars 34 forks source link

Assertion error using nested dependencies #27

Closed garthenweb closed 7 years ago

garthenweb commented 7 years ago

When bundling files with nested dependencies splittable stops with AssertionError: Should be in at least 1 bundle c.js.

To demonstrate this issue I created a test repository. When removing one level and importing c.js instead of b.js in a.js, splittable is working perfectly fine.

I guess this is related to the limitation documented the section "Possible improvements":

Splittable only supports one layer of bundle hierarchy. This can lead to an extremely bloated base bundle. Multiple layers could be supported at the price of greater complexity in several dimensions.

But I would not expect splittable to throw when using deeper nested dependencies.

Do I get something wrong here?

cramforce commented 7 years ago

I have good and bad news.

Good news: This was a legit bug and I fixed it. Bad news: The syntax you are using in in your example export * from './c'; is not currently supported by closure compiler.

cramforce commented 7 years ago

Fixed in splittable@2.1.1. Will leave open because this needs a regression test.

garthenweb commented 7 years ago

Thank you for the quick response and the solution! splittable is now working for me even with a larger code base, sadly I now have to fight with Clousure Compiler (not only with the syntax mentioned above). But that is not part of this repository...

Thanks again!

cramforce commented 7 years ago

Feel free to paste error messages. I can take a look if they are something that can be fixed on the splittable side.

On Tue, Nov 29, 2016 at 1:45 AM, Jannick Garthen notifications@github.com wrote:

Thank you for the quick response and the solution! splittable is now working for me even with a larger code base, sadly I now have to fight with Clousure Compiler (not only with the syntax mentioned above). But that is not part of this repository...

Thanks again!

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/cramforce/splittable/issues/27#issuecomment-263523660, or mute the thread https://github.com/notifications/unsubscribe-auth/AAFeT8b-uyxygH2vUNsQVG-JPjE21NJ3ks5rC_REgaJpZM4K85ui .