Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
});
// get user config
let config = null;
let returnedWatchConfig = null;
try {
const configObj = getConfig({ cwd });
({ config } = configObj);
returnedWatchConfig = configObj.watch;
debug(`user config: ${JSON.stringify(config)}`);
} catch (e) {
console.error(chalk.red(e.message));
debug('Get .webpackrc config failed, watch config and reload');
// 监听配置项变更,然后重新执行 dev 逻辑
watchConfigs().on('all', (event, path) => {
debug(`[${event}] ${path}, unwatch and reload`);
unwatchConfigs();
runDev(opts);
});
return;
}
// get webpack config
const webpackConfig = getWebpackConfig({
cwd,
config,
babel,
paths,
entry,
});