Search code examples
webpackwebpack-2

how to output independent css use webpack?


I have two entry file:pc.js and wap.js ,they require a same js (a.js);

now a.js require two css file(a.css,b.css);

In webpack 2 ,how to output two css file (a.css=>pc.css,b.css=>wap.css)?


Solution

  • I suggest adding new entries, meanwhile use extract-css... plugin to get standalone CSS files.

    For details please check this page: https://github.com/webpack/webpack/tree/master/examples/multiple-entry-points-commons-chunk-css-bundle