refactor: fallback to babel-preset-env defualt targets when buildTarget is not specified

This commit is contained in:
Clark Du 2019-02-13 11:26:05 +00:00
parent aad46ed674
commit 176641f6cb

View File

@ -49,7 +49,7 @@ module.exports = (context, options = {}) => {
let { targets } = options let { targets } = options
if (modern === true) { if (modern === true) {
targets = { esmodules: true } targets = { esmodules: true }
} else if (targets === undefined) { } else if (targets === undefined && typeof buildTarget === 'string') {
targets = buildTarget === 'server' ? { node: 'current' } : { ie: 9 } targets = buildTarget === 'server' ? { node: 'current' } : { ie: 9 }
} }