Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default function getWebpackCommonConfig(mode, env) {
const { isDev, choerodonConfig: { masterName: masterName = 'master' } } = context;
const babelOptions = getBabelCommonConfig(mode, env);
const tsOptions = getTSCommonConfig();
const plugins = [
new FilterWarningsPlugin({
exclude: /.*@choerodon.*/,
}),
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks: Infinity,
}),
new ExtractTextPlugin({
filename: cssFileName,
disable: false,
allChunks: true,
}),
new CaseSensitivePathsPlugin(),
new webpack.ProgressPlugin((percentage, msg, addInfo) => {
const stream = process.stderr;
if (stream.isTTY) {
if (stream.isTTY && percentage < 0.71) {
const overridePlugins = (plugins: any, env: string) => {
plugins[0].options.inject = 'head';
plugins.push(
new EventHooksPlugin({
done: new PromiseTask(() => copyBundleScript(env)),
}),
);
plugins.push(
new FilterWarningsPlugin({
exclude: [/Module not found.*/, /Critical dependency: the request of a dependency is an expression/],
}),
);
return plugins;
};