Skip to content

Instantly share code, notes, and snippets.

@sleepiecappy
Created December 5, 2018 22:42
Show Gist options
  • Save sleepiecappy/03af6ea579517b4661e9079844eb3044 to your computer and use it in GitHub Desktop.
Save sleepiecappy/03af6ea579517b4661e9079844eb3044 to your computer and use it in GitHub Desktop.
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