Base on https://github.com/electron/electron-quick-start-typescript.
From your command line:
# Clone this repository
git clone https://github.com/yantze/electron-quick-start-typescript-vue
# Go into the repository
cd electron-quick-start-typescript-vue
# Install dependencies
npm install
# Run the app
npm start
Check detail in .vscode
npm i -D electron-webpack-vue electron-webpack-ts
Add lib section for es2015, or not will case can not find module fs.
{
"extends": "./node_modules/electron-webpack/tsconfig-base.json",
"compilerOptions": {
"module": "esnext",
"outDir": "dist",
"baseUrl": ".",
"lib": [
"es2015",
],
"paths": {
"*": [
"node_modules/*"
]
}
},
"include": [
"src/**/*",
"static/**/*",
]
}
Use this instead of inline template
// src/renderer/index.ts
import Vue from "vue";
import App from "./components/App.vue";
new Vue({
el: "#app",
render: h => h(App)
});