How to configure "~" alias when working with Docker?
Currently I have not set
"alias"
(thus using the defaults) in nuxt.config.js
.
I use paths like
This works fine when running dev server or building (which we do inside Docker).
VSCode on the other hand (working in the host) does not like this (see attachment).
The cause of the problem is that inside Docker the base path is at /var/app
while on the host this is mapped to /user/me/projects/myproject
.
Is there a way to get aliasses to work both inside and outside Docker?1 Reply
I seem to have found a solution.
The
tsconfig.json
option "paths"
actually uses relative paths, so they will work both inside Docker and outside Docker.
Added this to my tsconfig.json
:
Now VSCode understands where to look for ~/assets
and so on.