Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
initConfigPlugins() {
const map = requireindex(join(__dirname, 'getConfig/configPlugins'));
let plugins = Object.keys(map)
.filter(key => !key.includes('.test.'))
.map(key => {
return map[key].default;
});
plugins = this.service.applyPlugins('_registerConfig', {
initialValue: plugins,
});
this.plugins = plugins.map(p => p(this));
}
import { existsSync } from 'fs';
import { join } from 'path';
import { clearConsole } from 'af-webpack/react-dev-utils';
import chalk from 'chalk';
import isEqual from 'lodash.isequal';
import didyoumean from 'didyoumean';
import requireindex from 'requireindex';
import { CONFIG_FILES } from '../constants';
import { watch, unwatch } from './watch';
import { setConfig } from '../createRouteMiddleware';
const pluginsMap = requireindex(join(__dirname, './configPlugins'));
const plugins = Object.keys(pluginsMap).map(key => {
return pluginsMap[key].default();
});
let devServer = null;
function printError(messages) {
if (devServer) {
devServer.sockWrite(
devServer.sockets,
'errors',
typeof messages === 'string' ? [messages] : messages,
);
}
}
function printWarn(messages) {