nav tabs on admin dashboard

This commit is contained in:
2019-03-07 00:20:34 -06:00
parent f73d6ae228
commit e4f473f376
11661 changed files with 216240 additions and 1544253 deletions

View File

@@ -8,23 +8,29 @@ const CaseSensitiveModulesWarning = require("./CaseSensitiveModulesWarning");
class WarnCaseSensitiveModulesPlugin {
apply(compiler) {
compiler.plugin("compilation", compilation => {
compilation.plugin("seal", () => {
const moduleWithoutCase = Object.create(null);
compilation.modules.forEach(module => {
const identifier = module.identifier().toLowerCase();
if(moduleWithoutCase[identifier]) {
moduleWithoutCase[identifier].push(module);
} else {
moduleWithoutCase[identifier] = [module];
compiler.hooks.compilation.tap(
"WarnCaseSensitiveModulesPlugin",
compilation => {
compilation.hooks.seal.tap("WarnCaseSensitiveModulesPlugin", () => {
const moduleWithoutCase = new Map();
for (const module of compilation.modules) {
const identifier = module.identifier().toLowerCase();
const array = moduleWithoutCase.get(identifier);
if (array) {
array.push(module);
} else {
moduleWithoutCase.set(identifier, [module]);
}
}
for (const pair of moduleWithoutCase) {
const array = pair[1];
if (array.length > 1) {
compilation.warnings.push(new CaseSensitiveModulesWarning(array));
}
}
});
Object.keys(moduleWithoutCase).forEach(key => {
if(moduleWithoutCase[key].length > 1)
compilation.warnings.push(new CaseSensitiveModulesWarning(moduleWithoutCase[key]));
});
});
});
}
);
}
}