fix(babel-preset-app): respect explicit options.targets for modern preset (#9337)

This commit is contained in:
Xin Du (Clark) 2021-05-30 18:13:36 +01:00 committed by GitHub
parent b116d0ded4
commit b9bfb9df01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -97,12 +97,7 @@ module.exports = (api, options = {}) => {
modern: { esmodules: true } modern: { esmodules: true }
} }
let { targets = defaultTargets[envName] } = options const { targets = defaultTargets[envName] } = options
// modern mode can only be { esmodules: true }
if (envName === 'modern') {
targets = defaultTargets.modern
}
const polyfills = [] const polyfills = []