Webpack optimizations ()

* Less repetition in webpack configs. Minify CSS classnames in production.

* Ignore all optional deps of moment.js. Fixes 

* Added target to webpack config

* Automatically extract all 3rd party modules into a separate 'vendor' chunk

* Inline only assets that are smaller than 10KB

* Added autoprefixer options

* Replaced sinfle babel transforms with the stage-1 preset. Cleaned up webpack configs.

* Do not include hot module replacement in production
This commit is contained in:
Andrey Okonetchnikov
2016-10-26 19:51:35 +02:00
committed by Cássio Souza
parent 5151e7cdb1
commit 434f45c97c
8 changed files with 69 additions and 58 deletions

@ -22,7 +22,7 @@ render((
</AppContainer>
), el);
if (module.hot) {
if (process.env.NODE_ENV !== 'production' && module.hot) {
module.hot.accept('./root', () => {
const NextRoot = require('./root').default;
render((

@ -8,7 +8,7 @@ export default function configureStore(initialState) {
window.devToolsExtension ? window.devToolsExtension() : f => f
));
if (module.hot) {
if (process.env.NODE_ENV !== 'production' && module.hot) {
// Enable Webpack hot module replacement for reducers
module.hot.accept('../reducers/combinedReducer', () => {
const nextReducer = require('../reducers/combinedReducer') // eslint-disable-line