Skip to content

Instantly share code, notes, and snippets.

@ufo22940268
Created February 29, 2016 08:25
Show Gist options
  • Save ufo22940268/d98e48560a7beb4ef726 to your computer and use it in GitHub Desktop.
Save ufo22940268/d98e48560a7beb4ef726 to your computer and use it in GitHub Desktop.
var webpack = require('webpack');
var path = require('path');
module.exports = {
devtool: 'cheap-module-eval-source-map',
entry: [
'webpack-hot-middleware/client',
__dirname + '/admin/public/jsx/index.jsx',
],
output: {
path: __dirname + '/admin/public',
filename: 'bundle.js',
publicPath: '/',
},
resolve: {
extensions: ['', '.js', '.jsx'],
root: [path.resolve('admin/public/')]
},
module: {
loaders: [
{
test: /\.css$/,
loader: 'style!css?modules',
},
{
test: /\.jsx*$/,
exclude: [/node_modules/, /.+\.config.js/],
loader: 'babel',
query: {
presets: ['react-hmre'],
},
}
],
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.DefinePlugin({
'process.env': {
CLIENT: JSON.stringify(true)
}
})
],
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment