electron-webpack-quick-start icon indicating copy to clipboard operation
electron-webpack-quick-start copied to clipboard

vue + typescript ?

Open davidm-public opened this issue 7 years ago • 2 comments

Very interesting project, though struggling to get Vue and Typescript working together.

for example renaming index.js to index.ts and adding this line:

import App from './view/App.vue'

Results in:

Module not found: Error: Can't resolve 'vue-loader' in '/Users/davem/Documents/electron/e2'
   @ ./src/renderer/index.ts 1:0-32
   @ multi (webpack)-dev-server/client?http://localhost:9080 webpack/hot/dev-server ./node_modules/electron-webpack/vue-renderer-entry.js ./src/renderer/index.ts

Am guessing that I need to webpack-merge in the vue-loader though not exactly sure what electron-webpack is providing vs what it expects to have provided in terms off webpack configuration?

An example with Vue and Typescript working would be much appreciated!!

davidm-public avatar Jan 16 '18 01:01 davidm-public

Supposedly you should be able to add electron-webpack-ts and electron-webpack-vue to your project, but I have not been able to get it working yet: https://github.com/electron-userland/electron-webpack/issues/264

partap avatar Jan 25 '19 19:01 partap

I managed to get it working by adding a "magic" file that vue-cli generates for typescript projects: shims-vue.d.ts.

I'd love it somebody could explain to me exactly what it does, but meanwhile, my fork of electron-webpack-quick-start with working vue + typescript is here:

https://github.com/partap/electron-webpack-quick-start

partap avatar Jan 28 '19 21:01 partap