electronmon icon indicating copy to clipboard operation
electronmon copied to clipboard

Cannot find module '@/src/xxx'

Open hu243285237 opened this issue 2 years ago • 1 comments

how to parse url like "@/src/xxx" in main process?

here is package script: "start:main": "cross-env NODE_ENV=development electronmon -r ts-node/register/transpile-only ."

and here is part of tsconfig:

"baseUrl": "./",
"paths": { "@/*": ["./*"] }

but i got error "Cannot find module '@/src/xxx'"

hu243285237 avatar Jun 01 '23 07:06 hu243285237

I have tried to get this working and had little luck, this library looks as though it should help but it didn't work well with electronmon. In my case I think this is an issue with how ts config are shared across processes, and, how I have my repo setup for which I used electron-react-booilerplate.

https://www.npmjs.com/package/tsconfig-paths

SampsonM-SBG avatar Aug 01 '23 15:08 SampsonM-SBG