diff --git a/packages/uni-template-compiler/lib/index.js b/packages/uni-template-compiler/lib/index.js index a255a539a65a7b437d24481ec211ceb6af4e41e6..920a9da232a76028c131b180b327ce287acaf9f0 100644 --- a/packages/uni-template-compiler/lib/index.js +++ b/packages/uni-template-compiler/lib/index.js @@ -38,9 +38,7 @@ const isWin = /^win/.test(process.platform) const normalizePath = path => (isWin ? path.replace(/\\/g, '/') : path) module.exports = { - compile (source, options = {}) { - options.modules.push(compilerModuleUniad) - + compile (source, options = {}) { if ( // 启用摇树优化后,需要过滤内置组件 !options.autoComponentResourcePath || options.autoComponentResourcePath.indexOf('@dcloudio/uni-h5/src') === -1 @@ -49,7 +47,10 @@ module.exports = { } if (!options.modules) { options.modules = [] - } + } + + options.modules.push(compilerModuleUniad) + // transformAssetUrls options.modules.push(require('./asset-url')) options.modules.push(require('./bool-attr'))