Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import getUserConfigPlugins from 'af-webpack/getUserConfigPlugins';
import { compatDirname } from 'umi-utils';
import { join, dirname } from 'path';
import { webpackHotDevClientPath } from 'af-webpack/react-dev-utils';
const plugins = getUserConfigPlugins();
function noop() {
return true;
}
const excludes = ['entry', 'outputPath'];
export default function(api) {
const { debug, cwd, config, paths } = api;
// 把 af-webpack 的配置插件转化为 umi-build-dev 的
api._registerConfig(() => {
return plugins
.filter(p => !excludes.includes(p.name))
.map(({ name, validate = noop, ...extraOpts }) => {
return api => ({