Skip to content

Instantly share code, notes, and snippets.

@iamkevingreen
Created January 27, 2017 16:15
Show Gist options
  • Save iamkevingreen/250c9a4e08d42fe5274c6452780d11cb to your computer and use it in GitHub Desktop.
Save iamkevingreen/250c9a4e08d42fe5274c6452780d11cb to your computer and use it in GitHub Desktop.
// webpack.config.js
var path = require('path');
var webpack = require('webpack');
var config = {
context: __dirname + '/src',
entry: {
app: ['webpack/hot/dev-server', './app.js']
},
output: {
path: path.resolve(__dirname, 'build'),
filename: 'app.bundle.js',
publicPath: 'http://localhost:8080/build/'
},
devServer: {
contentBase: './public',
publicPath: 'http://localhost:8080/build/'
},
module: {
loaders: [
{
test: /\.js$/,
loader: 'babel-loader',
query: {
presets: ['es2015', 'react']
}
},
{
test: /\.json$/,
loader: "json-loader"
},
{
test: /\.scss$/,
loader: 'style!css!autoprefixer?browsers=last 2 version!sass?outputStyle=expanded'
}
]
},
stats: {
colors: true
},
devtool: 'source-map',
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.IgnorePlugin(new RegExp("^(fs|ipc)$"))
]
};
module.exports = config;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment