From 767fe6b4b4d4980b5b5cf8fd5dafb0aa84465625 Mon Sep 17 00:00:00 2001 From: Rishabh Chawla Date: Sat, 9 Jan 2021 21:26:44 +0530 Subject: [PATCH] chore: remove stale code (#2337) --- packages/generators/src/utils/index.ts | 2 -- .../generators/src/utils/webpackConfig.ts | 30 ------------------- 2 files changed, 32 deletions(-) delete mode 100644 packages/generators/src/utils/webpackConfig.ts diff --git a/packages/generators/src/utils/index.ts b/packages/generators/src/utils/index.ts index bf086d13c8e..99f132a1377 100644 --- a/packages/generators/src/utils/index.ts +++ b/packages/generators/src/utils/index.ts @@ -4,7 +4,6 @@ import plugins, { replaceAt, generatePluginName } from './plugins'; import styleQuestionHandler, { StylingType, LoaderName, StyleRegex, Loader } from './styleSupport'; import tooltip from './tooltip'; import validate from './validate'; -import { getDefaultOptimization } from './webpackConfig'; export { entryQuestions, @@ -22,5 +21,4 @@ export { Loader, tooltip, validate, - getDefaultOptimization, }; diff --git a/packages/generators/src/utils/webpackConfig.ts b/packages/generators/src/utils/webpackConfig.ts deleted file mode 100644 index b849bd3745e..00000000000 --- a/packages/generators/src/utils/webpackConfig.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { WebpackOptions } from '../types'; - -export function getDefaultOptimization(usingDefaults: boolean): WebpackOptions['optimization'] { - let optimizationOptions; - if (!usingDefaults) { - optimizationOptions = { - minimizer: ['new TerserPlugin()'], - splitChunks: { - cacheGroups: { - vendors: { - priority: -10, - test: '/[\\\\/]node_modules[\\\\/]/', - }, - }, - chunks: "'async'", - minChunks: 1, - minSize: 30000, - name: false, - }, - }; - } else { - optimizationOptions = { - minimizer: ['new TerserPlugin()'], - splitChunks: { - chunks: "'all'", - }, - }; - } - return optimizationOptions; -}