From 1453618afcb8d9ee4a0a5e8d934070732dabe7a6 Mon Sep 17 00:00:00 2001 From: handongxun Date: Fri, 13 May 2022 11:56:59 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20vue2=20ad=20=E7=BB=84=E4=BB=B6=E8=AE=BE?= =?UTF-8?q?=E7=BD=AEadpid=E5=90=8E=E7=BC=96=E8=AF=91=E5=88=B0=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E5=B0=8F=E7=A8=8B=E5=BA=8F=E6=97=B6=E7=BC=BA=E5=B0=91?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E7=BB=84=E4=BB=B6=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/uni-template-compiler/lib/index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/uni-template-compiler/lib/index.js b/packages/uni-template-compiler/lib/index.js index 920a9da23..c9b0280d3 100644 --- a/packages/uni-template-compiler/lib/index.js +++ b/packages/uni-template-compiler/lib/index.js @@ -38,7 +38,11 @@ const isWin = /^win/.test(process.platform) const normalizePath = path => (isWin ? path.replace(/\\/g, '/') : path) module.exports = { - compile (source, options = {}) { + compile (source, options = {}) { + if (Array.isArray(options.modules)) { + options.modules.push(compilerModuleUniad) + } + if ( // 启用摇树优化后,需要过滤内置组件 !options.autoComponentResourcePath || options.autoComponentResourcePath.indexOf('@dcloudio/uni-h5/src') === -1 @@ -48,8 +52,6 @@ module.exports = { if (!options.modules) { options.modules = [] } - - options.modules.push(compilerModuleUniad) // transformAssetUrls options.modules.push(require('./asset-url')) -- GitLab