Skip to content

Instantly share code, notes, and snippets.

@pbojinov
Last active March 17, 2016 23:13
Show Gist options
  • Save pbojinov/e87fb7aaf497faf14057 to your computer and use it in GitHub Desktop.
Save pbojinov/e87fb7aaf497faf14057 to your computer and use it in GitHub Desktop.
universal-react webpack config
'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