nav tabs on admin dashboard
This commit is contained in:
+31
-21
@@ -9,8 +9,6 @@ class Preprocessor {
|
||||
*/
|
||||
webpackEntry(entry) {
|
||||
this.details.forEach(detail => {
|
||||
if (detail.type === 'fastsass') return;
|
||||
|
||||
entry.add(entry.keys()[0], detail.src.path());
|
||||
});
|
||||
}
|
||||
@@ -22,8 +20,6 @@ class Preprocessor {
|
||||
let rules = [];
|
||||
|
||||
this.details.forEach(preprocessor => {
|
||||
if (preprocessor.type === 'fastsass') return;
|
||||
|
||||
let outputPath = preprocessor.output.filePath
|
||||
.replace(Config.publicPath + path.sep, path.sep)
|
||||
.replace(/\\/g, '/');
|
||||
@@ -88,22 +84,18 @@ class Preprocessor {
|
||||
if (preprocessor.type !== 'postCss') {
|
||||
loaders.push({
|
||||
loader: `${preprocessor.type}-loader`,
|
||||
options: Object.assign(preprocessor.pluginOptions, {
|
||||
sourceMap:
|
||||
preprocessor.type === 'sass' &&
|
||||
Config.processCssUrls
|
||||
? true
|
||||
: Mix.isUsing('sourcemaps')
|
||||
})
|
||||
options: this.loaderOptions(preprocessor)
|
||||
});
|
||||
}
|
||||
|
||||
rules.push({
|
||||
test: preprocessor.src.path(),
|
||||
use: extractPlugin.extract({
|
||||
fallback: 'style-loader',
|
||||
use: loaders
|
||||
})
|
||||
use: Mix.isUsing('hmr')
|
||||
? ['style-loader', ...loaders]
|
||||
: extractPlugin.extract({
|
||||
fallback: 'style-loader',
|
||||
use: loaders
|
||||
})
|
||||
});
|
||||
|
||||
this.extractPlugins = (this.extractPlugins || []).concat(
|
||||
@@ -122,6 +114,26 @@ class Preprocessor {
|
||||
return this.extractPlugins;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare the preprocessor plugin options.
|
||||
*
|
||||
* @param {Object} preprocessor
|
||||
*/
|
||||
loaderOptions(preprocessor) {
|
||||
tap(preprocessor.pluginOptions.implementation, implementation => {
|
||||
if (typeof implementation === 'function') {
|
||||
preprocessor.pluginOptions.implementation = implementation();
|
||||
}
|
||||
});
|
||||
|
||||
return Object.assign(preprocessor.pluginOptions, {
|
||||
sourceMap:
|
||||
preprocessor.type === 'sass' && Config.processCssUrls
|
||||
? true
|
||||
: Mix.isUsing('sourcemaps')
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a generic CSS preprocessor.
|
||||
*
|
||||
@@ -129,8 +141,9 @@ class Preprocessor {
|
||||
* @param {string} src
|
||||
* @param {string} output
|
||||
* @param {object} pluginOptions
|
||||
* @param {Array} postCssPlugins
|
||||
*/
|
||||
preprocess(type, src, output, pluginOptions = {}) {
|
||||
preprocess(type, src, output, pluginOptions = {}, postCssPlugins = []) {
|
||||
Assert.preprocessor(type, src, output);
|
||||
|
||||
src = new File(src);
|
||||
@@ -144,13 +157,10 @@ class Preprocessor {
|
||||
type: this.constructor.name.toLowerCase(),
|
||||
src,
|
||||
output,
|
||||
pluginOptions
|
||||
pluginOptions,
|
||||
postCssPlugins
|
||||
});
|
||||
|
||||
if (type === 'fastSass') {
|
||||
Mix.addAsset(output);
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user