-
Notifications
You must be signed in to change notification settings - Fork 32
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
Code splitting on import("...")
#387
Comments
The build tool should support In terms of bundling by configuration, we strongly believe it's better to decouple bundling semantics from code, and this was a pattern used in the dojo 1 build tool to good effect. It provides numerous advantages:
In general we try and also abstract away the sync/async nature of this loading too, for example for widgets themselves a user can just use a normal I'm going to close this as working as designed given how the issue is currently written. If their is a bug with a specific scenario of |
Thank you very much for the input.
I missed this as I forgot tsc in a depending project will effectively re-transpile dependencies with it's own module settings, and I had already got the settings correct in the dependency. I might have a look at updating the dojo docs to reflect that code splitting can be achieved using The only remaining confusion is that I don't yet know what's causing this, but frankly it's not currently bothering me much. |
Enhancement
Webpack (and other bundlers) support automatic code splitting on
import()
statements. This can be especially useful for large libraries with lots of code which is only used when performing certain tasks (an example might be drag and drop folder support, also accepting different archive formats like zip/tar, I could avoid loading a js implementation of various compression algorithms unless they're actually needed).Currently dojo will bundle the code imported by the
import()
statement within the main bundle.Only supporting code-splitting by app routes seems overly restrictive to me, and the
bundles
key feels like a leaking of concerns to config (and especially brittle).Package Version: 6.0.3
I presume the current behaviour comes from this function.
The text was updated successfully, but these errors were encountered: