I need to make my Vue project compatible with an old iPad running iOS/safari version 5, which requires transpiling it to ES5 using Babel.
Here is the content of my babel.config.js
:
presets: [
//'@vue/cli-plugin-babel/preset',
["@babel/env",
{
targets: {
safari: "5",
ios: "5",
},
useBuiltIns: "usage",
"corejs": "3.6.4",
},]
]
}
When I run npx babel src --out-dir dist
, only the .js files are compiled into the dist folder. The .vue files, static assets, and html files are not included in the compilation process.
How can I configure Babel to compile all file types, and are there any additional steps required to successfully transpile my project to ES5?
Below is the information from my package.json
:
{
"name": "frontend",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"@babel/polyfill": "^7.12.1",
"axios": "^0.20.0",
"core-js": "^3.6.5",
"sass": "^1.27.0",
"sass-loader": "^10.0.3",
"vue": "^2.6.11",
"vue-axios": "^2.1.5",
"vue-device-detector": "^1.1.6",
"vue-material": "^1.0.0-beta-15",
"vue-router": "^3.2.0",
"vuelidate": "^0.7.5"
},
"devDependencies": {
"@babel/cli": "^7.12.1",
"@babel/core": "^7.12.3",
"@babel/preset-env": "^7.12.1",
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2",
"vue-template-compiler": "^2.6.11"
}
}