Ver código fonte

优化打包

tianyunperfect 4 anos atrás
pai
commit
8e9d24c8ed
1 arquivos alterados com 0 adições e 22 exclusões
  1. 0 22
      config/plugin.config.ts

+ 0 - 22
config/plugin.config.ts

@@ -1,26 +1,4 @@
-import path from 'path';
-
 import * as IWebpackChainConfig from 'webpack-chain';
-
-function getModulePackageName(module: { context: string }) {
-  if (!module.context) return null;
-
-  const nodeModulesPath = path.join(__dirname, '../node_modules/');
-  if (module.context.substring(0, nodeModulesPath.length) !== nodeModulesPath) {
-    return null;
-  }
-
-  const moduleRelativePath = module.context.substring(nodeModulesPath.length);
-  const [moduleDirName] = moduleRelativePath.split(path.sep);
-  let packageName: string | null = moduleDirName;
-  // handle tree shaking
-  if (packageName && packageName.match('^_')) {
-    // eslint-disable-next-line prefer-destructuring
-    packageName = packageName.match(/^_(@?[^@]+)/)![1];
-  }
-  return packageName;
-}
-
 const webpackPlugin = (config: IWebpackChainConfig) => {
   config.merge({
     optimization: {