Dynamically Load from different Bundles #4661
Replies: 3 comments 2 replies
-
I don't fully understand what you want to achieve, but with Parcel 2, the bundler plugin is in full control over how assets are grouped into bundles.
So you want an import statement that loads things from multiple objects at the same time? |
Beta Was this translation helpful? Give feedback.
-
OK, so I'm on y way to documenting this more fully, but as I work this out in my head I have in interim question that will help me get there. Say I have two packages:
This results in the following bundled files in
QuestionWhat I'm figuring out is how I can dynamically import Use-Case:**
More Concrete Scenario:
My rough tests of just dynamically loading the script does nothing, so clearly that's not the way to achieve this.
Thanks @mischnic |
Beta Was this translation helpful? Give feedback.
-
Closing this out - what I was asking for here I now see detailed in the upcoming "Module Federation" designs in Webpack 5. Now I can see this thinking laid mirrored in the direction of Webpack, wondering if something like this is on the drawing board for coming to Parcel? |
Beta Was this translation helpful? Give feedback.
-
The CodeSplitting (via the dynamic
import()
statement) is really nice.However, I'm trying to think my way through an approach to progressively loading code (JS) from different bundles.
Is there a way to do this. The scenario is I have essentially a "vendor" type scenario, where I say have multiple bundles, which can progressively load code from other bundles over the network.
Is there an approach to this. The defactor
import()
code-splitting seems to assume this is all coming from the one module. What's my move?Thanks!!! 🌼🍰
Beta Was this translation helpful? Give feedback.
All reactions