gutter-preview icon indicating copy to clipboard operation
gutter-preview copied to clipboard

mapping paths and alias

Open Minori-ty opened this issue 2 years ago • 4 comments

first, replace "@" with "$" second, use "$xxx"

for example

    "gutterpreview.paths": {
        "$src": "${workspaceFolder}/src"
    },

then,you can use the alias for html

   <img src="src/assets/logo.png" alt="" />
   <img src="$src/assets/logo.png" alt="" />

image

Minori-ty avatar Jul 07 '22 15:07 Minori-ty

but how can I use the alias with "@"? It don't work :(

Minori-ty avatar Jul 07 '22 15:07 Minori-ty

Are you windows system? If yes, #138 may be able to help you. I released an interim version, you can try this. then setting.json

"gutterpreview.paths": {
    "@": "./src"
},

or tsconfig.json

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

dusionlike avatar Sep 28 '22 04:09 dusionlike

Are you windows system? If yes, #138 may be able to help you. I released an interim version, you can try this. then setting.json

"gutterpreview.paths": {
    "@": "./src"
},

or tsconfig.json

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

jsconfig.json is unsuccessful, but tsconfig.json is succeed

mxp131011 avatar Oct 07 '22 04:10 mxp131011

'gutterpreview.paths' can also

mxp131011 avatar Oct 07 '22 04:10 mxp131011

Are you windows system? If yes, #138 may be able to help you. I released an interim version, you can try this. then setting.json

"gutterpreview.paths": {
    "@": "./src"
},

or tsconfig.json

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

It's useful, thank you! But it don‘t work by start with '/@/', and vben's alias is start with '/@/', could you resolve this problem? please~ image

Minori-ty avatar Oct 26 '22 07:10 Minori-ty

Are you windows system? If yes, #138 may be able to help you. I released an interim version, you can try this. then setting.json

"gutterpreview.paths": {
    "@": "./src"
},

or tsconfig.json

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

thanks,it works for me.

Vsnoy avatar Nov 04 '22 13:11 Vsnoy

"@": "./src"

image

"gutterpreview.paths": {
    "@": "./src"
},

It doesn't work

xiangdongbu avatar Aug 18 '23 06:08 xiangdongbu