Is there a way to compile and construct my TypeScript Vue application using only Babel? After extensively utilizing vue-cli-service, I've come to the point where I require a more minimal setup, eliminating the need for webpack or any other similar tools.
This is my .babelrc configuration:
{
"presets": ["babel-preset-typescript-vue"],
"plugins": ["@babel/plugin-transform-typescript"]
}
Here are the dependencies listed in my package.json file:
"devDependencies": {
"@babel/cli": "^7.10.5",
"@babel/plugin-transform-typescript": "^7.11.0",
"@babel/preset-env": "^7.11.0",
"babel-loader": "^8.1.0",
"babel-preset-env": "^1.7.0",
"babel-preset-typescript-vue": "^1.1.1",
"typescript": "~3.9.3",
"vue-template-compiler": "^2.6.11"
},
"dependencies": {
"vue": "^2.6.12",
"vue-class-component": "^7.2.3",
"vue-property-decorator": "^8.4.2",
"vuex": "^3.5.1"
}
This is my main.ts entry file:
import Vue from 'vue'
import Vuex from 'vuex';
import App from './App.vue'
Vue.config.productionTip = false;
Vue.use(Vuex);
new Vue({render: h => h(App)}).$mount('#app');
And here's my App.vue file:
<script lang="ts">
import {Component, Vue} from 'vue-property-decorator';
@Component
class App extends Vue {}
export default App;
</script>
<template>
<div class="foobar">Babel worked</div>
</template>
This is how I run my build script with Babel:
babel src/main.ts --out-dir build