Webpack with an array provided as config

前端 未结 2 715
粉色の甜心
粉色の甜心 2021-02-05 02:06

In this webpack starter kit https://github.com/webpack/react-starter I see the webpack.production.config.js module does not export only a config object but an array of config ob

相关标签:
2条回答
  • 2021-02-05 02:31

    Can be used to produce two different outputs - otherwise undoable in Webpack (AFAIK).

    Eg: Produce full Production-ready output config into wwwroot directory in an ASP.Net Server-side web app, so that you can run and test everything by running the ASP.Net app on IIS, in Visual Studio WHILE SIMULTANEOUSLY Produce a simple HTML page (with HtmlWebpackPlugin) into your_app/dist folder, so you can run just the JS app and on Webpack DevServer and edit the JS app, in VSCode

    Two people could work side by side on the same project, at the same time, the way John Lennon Imagined...

    0 讨论(0)
  • 2021-02-05 02:53

    Passing an array enables Webpack's multi-compiler mode. It's just a way to run Webpack multiple times in one pass. For instance, if you're making a Chrome & Firefox extension, you could use the multi-compiler to create both at once.

    Webpack Multi-compiler example using mobile/desktop bundles.

    0 讨论(0)
提交回复
热议问题