Skip to content

Instantly share code, notes, and snippets.

@jprivillaso
Created April 23, 2017 13:10
Show Gist options
  • Save jprivillaso/40fbf8f55b7c967170774ec2be047d79 to your computer and use it in GitHub Desktop.
Save jprivillaso/40fbf8f55b7c967170774ec2be047d79 to your computer and use it in GitHub Desktop.
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
devtool: 'eval-source-map',
entry: [
'webpack-hot-middleware/client?reload=true',
path.join(__dirname, 'src/viridis.ui.widget.js')
],
output: {
path: path.join(__dirname, '/dist/'),
filename: 'bundle.js',
publicPath: '/static'
},
plugins: [
new HtmlWebpackPlugin({
template: 'src/index.tmpl.html',
inject: 'body',
filename: 'index.html'
}),
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('development')
})
],
module: {
loaders: [{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel',
query: {
"presets": ["react", "es2015", "stage-0", "react-hmre"]
}
}, {
test: /\.json?$/,
loader: 'json'
}, {
test: /\.css$/,
loader: 'style!css?modules&localIdentName=[name]---[local]---[hash:base64:5]'
}]
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment