2017-10-01 13:02:25 -05:00
|
|
|
'use strict';
|
|
|
|
|
2018-06-26 03:28:37 -05:00
|
|
|
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
2017-10-01 13:02:25 -05:00
|
|
|
|
2018-06-26 03:28:37 -05:00
|
|
|
module.exports = function(options) {
|
2017-10-01 13:02:25 -05:00
|
|
|
return {
|
|
|
|
test: /\.scss$/,
|
2018-06-26 03:28:37 -05:00
|
|
|
use: [
|
|
|
|
MiniCssExtractPlugin.loader,
|
|
|
|
{
|
|
|
|
loader: 'css-loader',
|
|
|
|
options: {
|
|
|
|
importLoaders: 2,
|
|
|
|
url: options.preserveUrl,
|
|
|
|
sourceMap: options.sourceMap,
|
|
|
|
minimize: options.minimize,
|
2017-10-01 13:02:25 -05:00
|
|
|
},
|
2018-06-26 03:28:37 -05:00
|
|
|
},
|
|
|
|
{
|
|
|
|
loader: 'postcss-loader',
|
2018-04-18 08:01:36 -05:00
|
|
|
options: {
|
2018-06-26 03:28:37 -05:00
|
|
|
sourceMap: options.sourceMap,
|
|
|
|
config: { path: __dirname + '/postcss.config.js' },
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{ loader: 'sass-loader', options: { sourceMap: options.sourceMap } },
|
|
|
|
],
|
2017-10-01 13:02:25 -05:00
|
|
|
};
|
2018-06-26 03:28:37 -05:00
|
|
|
};
|