2017-10-01 13:02:25 -05:00
|
|
|
'use strict';
|
|
|
|
|
2019-02-04 10:28:57 -06:00
|
|
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
2022-04-22 08:33:13 -05:00
|
|
|
const path = require('path');
|
2017-10-01 13:02:25 -05:00
|
|
|
|
2021-01-20 00:59:48 -06:00
|
|
|
module.exports = function (options) {
|
2017-10-01 13:02:25 -05:00
|
|
|
return {
|
|
|
|
test: /\.scss$/,
|
2021-08-31 05:55:05 -05:00
|
|
|
exclude: /node_modules/,
|
2018-06-26 03:28:37 -05:00
|
|
|
use: [
|
|
|
|
MiniCssExtractPlugin.loader,
|
|
|
|
{
|
|
|
|
loader: 'css-loader',
|
|
|
|
options: {
|
|
|
|
importLoaders: 2,
|
|
|
|
url: options.preserveUrl,
|
2020-08-11 10:52:44 -05:00
|
|
|
sourceMap: options.sourceMap,
|
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,
|
2021-08-31 05:55:05 -05:00
|
|
|
postcssOptions: {
|
|
|
|
config: path.resolve(__dirname),
|
|
|
|
},
|
2018-06-26 03:28:37 -05:00
|
|
|
},
|
|
|
|
},
|
2019-02-04 10:28:57 -06:00
|
|
|
{
|
|
|
|
loader: 'sass-loader',
|
|
|
|
options: {
|
2020-08-11 10:52:44 -05:00
|
|
|
sourceMap: options.sourceMap,
|
2019-02-04 10:28:57 -06:00
|
|
|
},
|
|
|
|
},
|
2018-06-26 03:28:37 -05:00
|
|
|
],
|
2017-10-01 13:02:25 -05:00
|
|
|
};
|
2018-06-26 03:28:37 -05:00
|
|
|
};
|