You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unfortunately current implementation of DOM-Router works only with regular modules, not the dynamic ones.
Dynamic approach to routes can help to split some heavy routes into separate chunks that loads on-demand through only one trigger - a classname of body tag.
I already made some changes in DOM-Router class to support require.ensured and import()ed modules (not supported in current sage's build system now).
vkryukov76
changed the title
Support dynamic requires (imports) in DOM-Router.
[Feature] Support dynamic requires (imports) in DOM-Router.
Mar 20, 2018
DOM-Router is very useful pattern.
But it has one small flaw - all routes always bundled into one file that loads on every page, even when most routes will never be fired.
Webpack has a great feature called dynamic imports.
Unfortunately current implementation of DOM-Router works only with regular modules, not the dynamic ones.
Dynamic approach to routes can help to split some heavy routes into separate chunks that loads on-demand through only one trigger - a classname of body tag.
I already made some changes in DOM-Router class to support
require.ensure
d andimport()
ed modules (not supported in current sage's build system now).vkryukov76@9b41139
If upstream and community will find it useful I will be glad to submit a PR.
The text was updated successfully, but these errors were encountered: