Open hyrious opened 3 years ago
maybe related: dividab/tsconfig-paths#128
Me recently work on an vite app which does not support path mapping starting with '@', instead it could use '/@' (vitejs/vite#279). However this extension can not handle these paths like "/@assets/aqua.png". I think it is caused by:
'@'
'/@'
"/@assets/aqua.png"
https://github.com/kisstkondoros/gutter-preview/blob/e8c746b66c3c6e7c505c1c575b6d2bc392c9a597/src/mappers/relativetoworkspacerootmapper.ts#L32
Me locally make some dirty works by adding these code and it seems to be working fine:
if (!firstSegment && this.aliases.indexOf('/' + segments[1]) > -1) { segments.shift(); // shift "" let aliases = this.paths['/' + segments[0]]; if (!Array.isArray(aliases)) aliases = [aliases]; aliases.forEach((alias) => { if (alias.endsWith('/')) alias = alias.substring(0, alias.length - 1); segments[0] = alias; const resolvedPath = segments.join('/'); pathsToTest.push(resolvedPath); }); }
Me recently work on an vite app which does not support path mapping starting with
'@'
, instead it could use'/@'
(vitejs/vite#279). However this extension can not handle these paths like"/@assets/aqua.png"
. I think it is caused by:https://github.com/kisstkondoros/gutter-preview/blob/e8c746b66c3c6e7c505c1c575b6d2bc392c9a597/src/mappers/relativetoworkspacerootmapper.ts#L32
Me locally make some dirty works by adding these code and it seems to be working fine: