Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
!('chainConfig' in afWebpackOpts),
`chainConfig should not supplied in modifyAFWebpackOpts`,
);
afWebpackOpts.chainConfig = webpackConfig => {
service.applyPlugins('chainWebpackConfig', {
args: webpackConfig,
});
if (config.chainWebpack) {
config.chainWebpack(webpackConfig, {
webpack: require('af-webpack/webpack'),
});
}
};
const webpackConfig: IWebpack.Configuration = service.applyPlugins('modifyWebpackConfig', {
initialValue: getConfig({
...afWebpackOpts,
ssr,
}),
});
if (ssr) {
// ssr in beta hint
console.warn(
chalk.keyword('orange')(
`WARNING: UmiJS SSR is still in beta, you can open issues or PRs in https://github.com/umijs/umi`,
),
);
const nodeExternalsOpts = {
whitelist: [
/\.(css|less|sass|scss)$/,
/^umi(\/.*)?$/,