Created
December 27, 2016 23:41
-
-
Save robbiemu/b3207c566a7897d2154a9274aaafeaf1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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