Created
December 4, 2016 23:36
-
-
Save Ch4s3/19e528ca7c412ec7a44dee8286c42921 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
"use strict"; | |
const path = require("path"); | |
const webpack = require("webpack"); | |
const ExtractTextPlugin = require("extract-text-webpack-plugin"); | |
const ClosureCompiler = require("google-closure-compiler-js").webpack; | |
module.exports = { | |
context: __dirname + "/source", | |
entry: { | |
site: "./javascripts/all.js", | |
}, | |
module: { | |
rules: [ | |
{ | |
test: /\.js$/, | |
use: [{ | |
loader: "babel-loader", | |
options: { presets: ["es2015"] } | |
}], | |
}, | |
{ | |
test: /\.(sass|scss)$/, | |
use: [{ | |
loader: ExtractTextPlugin.extract({ | |
fallbackLoader: ["style-loader"], | |
loader: [ | |
{ | |
loader: "css-loader", | |
options: { minimize: true, }, | |
}, | |
{ | |
loader: "sass-loader", | |
options: { outputStyle: "compressed", }, | |
}, | |
], | |
}), //end ExtractTextPlugin loader | |
}], | |
}, | |
],//end rules | |
}, | |
output: { | |
path: __dirname + "/build/javascripts", | |
filename: "[name].bundle.js", | |
}, | |
plugins: [ | |
new ExtractTextPlugin({ | |
filename: "../stylesheets/[name].bundle.css", | |
allChunks: true, | |
}), | |
new ClosureCompiler({ | |
options: { | |
processCommonJsModules: true, | |
createSourceMap: true, | |
languageIn: "ECMASCRIPT6", | |
languageOut: "ECMASCRIPT5", | |
compilationLevel: "ADVANCED", | |
warningLevel: "QUIET", | |
}, | |
}) | |
], | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment