diff --git a/packages/babel-preset-taro/index.js b/packages/babel-preset-taro/index.js index f8bf8c5ddcbb..6690d8fa84c8 100644 --- a/packages/babel-preset-taro/index.js +++ b/packages/babel-preset-taro/index.js @@ -162,7 +162,7 @@ module.exports = (_, options = {}) => { apis }]) } - if (options['dynamic-import-node'] || process.env.TARO_ENV !== 'h5') { + if (typeof options['dynamic-import-node'] === 'boolean' ? options['dynamic-import-node'] : process.env.TARO_ENV !== 'h5') { plugins.push([require('babel-plugin-dynamic-import-node')]) }