You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

74 lines
1.4 KiB

// ------------------
// @Table of Contents
// ------------------
/**
* + @Loading Dependencies
* + @Common Loaders
* + @Exporting Module
*/
// ---------------------
// @Loading Dependencies
// ---------------------
const path = require('path'),
cssNext = require('postcss-preset-env'),
rtlcss = require('rtlcss'),
ExtractTextPlugin = require('mini-css-extract-plugin'),
manifest = require('../manifest');
// ---------------
// @Common Loaders
// ---------------
const loaders = [
{
loader: 'css-loader',
options: {
sourceMap: manifest.IS_DEVELOPMENT,
},
},
{
loader: 'postcss-loader',
options: {
sourceMap: manifest.IS_DEVELOPMENT,
postcssOptions: {
plugins: [rtlcss(), cssNext()],
},
},
},
{
loader: 'sass-loader',
options: {
sourceMap: manifest.IS_DEVELOPMENT,
sassOptions: {
outputStyle: manifest.MINIFY ? 'compressed' : 'expanded',
includePaths: [
path.join('../../', 'node_modules'),
path.join(manifest.paths.src, 'assets', 'styles'),
path.join(manifest.paths.src, ''),
],
},
},
},
];
if (manifest.IS_PRODUCTION) {
loaders.unshift(ExtractTextPlugin.loader);
} else {
loaders.unshift({
loader: 'style-loader',
});
}
const rule = {
test: /\.scss$/,
use: loaders,
};
// -----------------
// @Exporting Module
// -----------------
module.exports = rule;