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.
 
 
 

72 lines
1.2 KiB

// ------------------
// @Table of Contents
// ------------------
/**
* + @Loading Dependencies
* + @Common Loaders
* + @Merging Production Loaders
* + @Merging Development Loaders
* + @Exporting Module
*/
// ---------------------
// @Loading Dependencies
// ---------------------
const
manifest = require('../manifest'),
ExtractTextPlugin = require('mini-css-extract-plugin');
// ---------------
// @Common Loaders
// ---------------
let rule = {};
const loaders = [
{
loader: 'css-loader',
options: {
sourceMap : manifest.IS_DEVELOPMENT,
importLoaders: 1,
},
},
];
// ---------------------------
// @Merging Production Loaders
// ---------------------------
if (manifest.IS_PRODUCTION) {
rule = {
test: /\.css$/,
use: [{
loader: ExtractTextPlugin.loader,
}].concat(loaders),
};
}
// ----------------------------
// @Merging Development Loaders
// ----------------------------
if (manifest.IS_DEVELOPMENT) {
rule = {
test: /\.css$/,
use: [{
loader: 'style-loader',
}].concat(loaders),
};
}
// -----------------
// @Exporting Module
// -----------------
module.exports = rule;