So I wanted to separate modules (and polyfills) from node_modules but the current state of Parcel doesn't really seem to do that...What if we could make the main app scripts separated like main.<hash>.js, vendor.<hash>.js and polyfill.<hash>.js? Thank you.
Indeed we could use something like:
const React, {Component} = import("react")
Yet it is smelly in terms of code and strays away from ES Standard. Definitely no good.
Edit: nope it doesn't work.
There is an RFC for this: #885. To make your code work you'd need to use await somewhere in an async function, or Promise.then :
const React, {Component} = await import("react")
I'll close this down as it's a duplicate/related and centralised discussion is always better
Most helpful comment
I'll close this down as it's a duplicate/related and centralised discussion is always better