Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var debug = process.env.NODE_ENV !== "production";
var webpack = require("webpack");
var ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
context: __dirname,
devtool: debug ? "inline-sourcemap" : null,
entry: [
"./js/main.js",
"./styles/application.scss",
],
output: {
path: __dirname + "/dist",
filename: "bundle.js"
},
module: {
loaders: [
{
test: /\.js$/,
loader: "babel-loader",
query: {
presets: ["es2015"]
}
},
{
test: /\.scss$/,
loader: ExtractTextPlugin.extract("style", "css", "sass"),
},
],
},
plugins: [
new ExtractTextPlugin("application.css")
].concat(
debug ? [] : [
new webpack.optimize.DedupePlugin(),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.UglifyJsPlugin({ mangle: false, sourcemap: false }),
]),
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment