From 03e053184ecdfdf861a4d9233dc154ff2d3382df Mon Sep 17 00:00:00 2001 From: luckyadam Date: Tue, 12 May 2020 22:31:21 +0800 Subject: [PATCH] =?UTF-8?q?fix(mini-runner):=20=E4=BF=AE=E5=A4=8D=20css-lo?= =?UTF-8?q?ader=20=E5=8D=87=E7=BA=A7=203.0.0=20=E5=90=8E=E5=B8=A6=E6=9D=A5?= =?UTF-8?q?=20breaking=20change=20=E9=97=AE=E9=A2=98=EF=BC=8Cclose=20#6191?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-webpack-runner/src/util/chain.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/taro-webpack-runner/src/util/chain.ts b/packages/taro-webpack-runner/src/util/chain.ts index 61e5a4c16251..a32f7423e617 100644 --- a/packages/taro-webpack-runner/src/util/chain.ts +++ b/packages/taro-webpack-runner/src/util/chain.ts @@ -229,11 +229,15 @@ const getModule = (appPath: string, { { importLoaders: 1, sourceMap: enableSourceMap, - modules: namingPattern === 'module' ? true : 'global' + modules: { + mode: namingPattern === 'module' ? 'local' : 'global' + } }, - typeof generateScopedName === 'function' + { + modules: typeof generateScopedName === 'function' ? { getLocalIdent: (context, _, localName) => generateScopedName(localName, context.resourcePath) } : { localIdentName: generateScopedName } + } ), cssLoaderOption ]