Skip to content

Instantly share code, notes, and snippets.

@Ch4s3
Created April 11, 2017 02:13
Show Gist options
  • Save Ch4s3/cdb399bf439bc85ce9b735e005b66686 to your computer and use it in GitHub Desktop.
Save Ch4s3/cdb399bf439bc85ce9b735e005b66686 to your computer and use it in GitHub Desktop.
"use strict";
const path = require("path");
const webpack = require("webpack");
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const cssLoaders = [
{
loader: "css-loader",
options: {
modules: true,
minimize: true
}
},
{
loader: "sass-loader"
}
]
module.exports = {
context: __dirname + "/source",
entry: {
site: "./javascripts/site.js",
},
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules)/,
loader: "babel-loader",
},
{
test: /\.(sass|scss)$/,
use: ExtractTextPlugin.extract({
fallback: "style-loader",
use: "css-loader"
})
},
],//end rules
},
output: {
path: __dirname + "/build/javascripts",
filename: "[name].bundle.js",
},
plugins: [
new webpack.LoaderOptionsPlugin({
minimize: true,
debug: false
}),
new ExtractTextPlugin({
filename: (getPath) => {
return getPath("[name].bundle.css").replace("css/js", "css");
},
disable: false,
allChunks: true,
}),
],
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment