Last active
March 17, 2016 23:13
-
-
Save pbojinov/e87fb7aaf497faf14057 to your computer and use it in GitHub Desktop.
universal-react webpack config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const path = require('path'); | |
const webpack = require('webpack'); | |
module.exports = { | |
devtool: '#source-map', | |
entry: [ | |
'webpack-hot-middleware/client', | |
'./app/index.js' | |
], | |
output: { | |
path: path.join(__dirname, 'dist'), | |
filename: 'app.js' | |
}, | |
plugins: [ | |
new webpack.HotModuleReplacementPlugin(), | |
new webpack.NoErrorsPlugin() | |
], | |
module: { | |
loaders: [{ | |
test: /\.css$/, | |
loader: 'style!css?modules', | |
include: /flexboxgrid/, | |
}, { | |
test: /\.js?$/, | |
loader: 'babel', | |
include: path.join(__dirname, 'app'), | |
query: { | |
plugins: [ | |
['react-transform', { | |
'transforms': [{ | |
transform: 'react-transform-hmr', | |
// If you use React Native, pass 'react-native' instead: | |
imports: ['react'], | |
// This is important for Webpack HMR: | |
locals: ['module'] | |
}] | |
}], | |
['transform-object-assign'] | |
] | |
} | |
}] | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment