У меня есть зависимость (vue2-google-maps), которая вызывает проблемы с моим приложением Vue в старых браузерах, вызывая ошибку при Object.entries
.
Чтении документов Vue CLI на полифиллах., я вижу упоминание о попытке загрузить полифилл в babel.config.js
.
My babel.config.js
:
module.exports = {
presets: [
['@vue/app', {
polyfills: [
'es6.object'
]
}]
]
}
Выдает ошибку:
Module build failed (from ./node_modules/babel-loader/lib/index.js):
TypeError: [BABEL] /PROJECT_DIR/src/main.js: Cannot read property 'android' of undefined (While processing: "/PROJECT_DIR/node_modules/@vue/babel-preset-app/index.js")
at targetEnvironments.filter.environment (/PROJECT_DIR/node_modules/@babel/preset-env/lib/index.js:75:16)
at Array.filter (<anonymous>)
at isPluginRequired (/PROJECT_DIR/node_modules/@babel/preset-env/lib/index.js:74:56)
at includes.filter.item (/PROJECT_DIR/node_modules/@vue/babel-preset-app/index.js:23:12)
at Array.filter (<anonymous>)
at getPolyfills (/PROJECT_DIR/node_modules/@vue/babel-preset-app/index.js:22:19)
at module.exports (/PROJECT_DIR/node_modules/@vue/babel-preset-app/index.js:94:17)
at loadDescriptor (/PROJECT_DIR/node_modules/@babel/core/lib/config/full.js:163:14)
at cachedFunction (/PROJECT_DIR/node_modules/@babel/core/lib/config/caching.js:42:19)
at loadPresetDescriptor (/PROJECT_DIR/node_modules/@babel/core/lib/config/full.js:233:63)
at config.presets.map.descriptor (/PROJECT_DIR/node_modules/@babel/core/lib/config/full.js:68:19)
at Array.map (<anonymous>)
at recurseDescriptors (/PROJECT_DIR/node_modules/@babel/core/lib/config/full.js:66:38)
at loadFullConfig (/PROJECT_DIR/node_modules/@babel/core/lib/config/full.js:106:6)
at process.nextTick (/PROJECT_DIR/node_modules/@babel/core/lib/transform.js:28:33)
at process._tickCallback (internal/process/next_tick.js:112:11)
@ multi (webpack)-dev-server/client?http://192.168.1.201:8080/sockjs-node (webpack)/hot/dev-server.js ./src/main.js
Что я делаю неправильно?Я создал проект с Vue CLI 3.0.3