loading...

re: Dynamic module import with Stimulus JS VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Actually you can do it anywhere with webpack, not only Stimulus. Thanks for quick tip!
 

Yes I didn't emphasize on it. You are right, this is a Webpack feature (probably also supported by other bundlers as it is a JS feature developer.mozilla.org/en-US/docs/W...).

The nice thing with Stimulus is that it pairs very well with the lifecycle events.

 

Just found this, so I'm a little late to the party, but rollup also has first class support for dynamic imports.

rollupjs.org/guide/en/#code-splitting

 

Indeed, forgot that browser modules have native support for dynamic imports.

code of conduct - report abuse