1. I am confused why you choose to use new ExtractTextPlugin('styles/main.css', { allChunks: true })
both on server and client in webpack.config.prod.js. Wouldn't styles/main.css be overwritten by the last execution (2nd one)? As I understand we only need one styles/main.css in our public folder. Why have two? Or do
new webpack.optimize.OccurenceOrderPlugin(),
new ExtractTextPlugin('styles/main.css', { allChunks: true })
do something magical together?
2. Can you also explain how ExtractTextPlugin works? Does it only get the style(s) from the entry file or it takes all styles from other components and bundles `em together?
3. Does postCSS/postcss-loader compile sass, so I dont need to use sass-loader?
Thanks :)
1. I am confused why you choose to use
new ExtractTextPlugin('styles/main.css', { allChunks: true })both on server and client in
webpack.config.prod.js. Wouldn'tstyles/main.cssbe overwritten by the last execution (2nd one)? As I understand we only need onestyles/main.cssin our public folder. Why have two? Or dodo something magical together?
2. Can you also explain how
ExtractTextPluginworks? Does it only get the style(s) from the entry file or it takes all styles from other components and bundles `em together?3. Does postCSS/postcss-loader compile sass, so I dont need to use
sass-loader?Thanks :)