Create individual SPA bundles with Webpack

后端 未结 3 1888
南旧
南旧 2020-12-23 11:39

How do I use Webpack to create independent SPA bundles that may or may not be loaded on the fly as my user navigates my SPA?

I have a contacts module, and a tasks mo

3条回答
  •  余生分开走
    2020-12-23 12:20

    I think require.ensure might be the key here. That will allow you to set up split points for dynamic loading. You would connect it with the router of your SPA in some way. Here's the basic idea from Pete Hunt: https://github.com/petehunt/webpack-howto#9-async-loading .

提交回复
热议问题