From 4ecdb24474d1934e0668d84f741af2b40f70575b Mon Sep 17 00:00:00 2001 From: luckyadam Date: Wed, 10 Jul 2019 22:20:25 +0800 Subject: [PATCH] =?UTF-8?q?fix(mini-runner):=20=E6=89=93=E5=8C=85=E4=BC=98?= =?UTF-8?q?=E5=8C=96=EF=BC=8C=E5=BC=95=E7=94=A8=E8=87=AA=20npm=20=E5=8C=85?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E7=BB=84=E4=BB=B6=E4=B8=8D=E6=8A=BD=E7=A6=BB?= =?UTF-8?q?=E8=87=B3=20vendors=20=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-mini-runner/src/webpack/build.conf.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/taro-mini-runner/src/webpack/build.conf.ts b/packages/taro-mini-runner/src/webpack/build.conf.ts index cc414dee640e..a43540262bd8 100644 --- a/packages/taro-mini-runner/src/webpack/build.conf.ts +++ b/packages/taro-mini-runner/src/webpack/build.conf.ts @@ -14,7 +14,7 @@ import { mergeOption, getMiniPlugin } from './chain' -import { BUILD_TYPES } from '../utils/constants' +import { BUILD_TYPES, PARSE_AST_TYPE } from '../utils/constants' import { Targets } from '../plugins/MiniPlugin' const emptyObj = {} @@ -139,7 +139,14 @@ export default (appPath: string, mode, config: Partial): any => { chunks: 'all', maxInitialRequests: Infinity, minSize: 0, - name: 'vendors' + name: 'vendors', + cacheGroups: { + vendors: { + test (module) { + return /[\\/]node_modules[\\/]/.test(module.resource) && module.miniType !== PARSE_AST_TYPE.COMPONENT + } + } + } } } })