Skip to content

Instantly share code, notes, and snippets.

@schoblaska
Created January 19, 2017 22:08
Show Gist options
  • Save schoblaska/3d765e8a94a665a7a1dd984b63aacba3 to your computer and use it in GitHub Desktop.
Save schoblaska/3d765e8a94a665a7a1dd984b63aacba3 to your computer and use it in GitHub Desktop.
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