Deluze / electron-vue-template

Simple Vue3 + Electron starter template in TypeScript, including ViteJS and Electron Builder
MIT License
534 stars 104 forks source link

Add alias for main process #15

Closed Dysey closed 1 year ago

Dysey commented 2 years ago

Hi,

How I can add alias for main process. I tried many thing like add package 'module-alias' but not work perfectly.

For renderer process it's easy in vite.js add a resolve like

resolve: { alias: { '@': Path.join(__dirname, '..', 'src', 'renderer') } }

Thank's for you help ! Kind Regards

Deluze commented 2 years ago

This isn't something that works out of the box with this template, unless tsc (the typescript compiler) supports this, which I don't think it does.

You'll have to find another package to extend the build pipeline for the main process.

I've heard of module-alias before, in what way didn't it work like you thought it did?