Created
December 5, 2018 22:42
-
-
Save sleepiecappy/03af6ea579517b4661e9079844eb3044 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
const MiniCssExtractPlugin = require("mini-css-extract-plugin"); | |
const devMode = process.env.NODE_ENV !== 'production' | |
module.exports = { | |
entry: './src/main/resources/assets/js/index.js', | |
output: { | |
filename: './js/index.js', | |
path: __dirname + '/src/main/resources/static/' | |
}, | |
module: { | |
rules: [ | |
{ | |
test: /\.js$/, | |
exclude: /node_modules/, | |
use: { | |
loader: "babel-loader" | |
} | |
}, | |
{ | |
test: /\.scss$/, | |
use: [ | |
{ | |
loader: MiniCssExtractPlugin.loader | |
}, | |
{ | |
loader: "css-loader", options: { | |
sourceMap: true | |
} | |
}, | |
{ | |
loader: 'postcss-loader', | |
options: { | |
plugins: function () { | |
return [ | |
require('precss'), | |
require('autoprefixer') | |
]; | |
} | |
} | |
}, | |
{ | |
loader: "sass-loader", options: { | |
sourceMap: true | |
} | |
} | |
] | |
} | |
] | |
}, | |
plugins: [ | |
new MiniCssExtractPlugin({ | |
filename: '/css/[name].css' | |
}) | |
] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment