Skip to content

Instantly share code, notes, and snippets.

@robbiemu
Created December 27, 2016 23:41
Show Gist options
  • Save robbiemu/b3207c566a7897d2154a9274aaafeaf1 to your computer and use it in GitHub Desktop.
Save robbiemu/b3207c566a7897d2154a9274aaafeaf1 to your computer and use it in GitHub Desktop.
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const BUILD_DIR = 'build'
module.exports = {
entry: './scripts/webpack_loader.js',
output: {
path: BUILD_DIR + '/scripts',
filename: "bundle.js"
},
devtool: "inline-source-map", // or "source-map"
module: {
loaders: [
{
test: /\.css$/, include: /styles/, loader:
ExtractTextPlugin.extract("style!css") },
{
test: /\.scss$/, include: /styles/, loaders: ExtractTextPlugin.extract(
"style-loader", "css-loader?sourceMap", "sass-loader?sourceMap")
},
{
test: /\.js$/, include: /scripts/, loader: 'babel',
query: {
presets: ['es2015', 'es2016']
}
}
],
plugins: [
new ExtractTextPlugin('*.css'),
new CopyWebpackPlugin([ {from: 'index.html'} ])
]
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment