How can I get the relative_filepath
without the extension and backslash change ?
I found two transforms:
"${RELATIVE_FILEPATH/[\\]/\//g/}"
"${RELATIVE_FILEPATH/(.js)//}"
If the relative file path is \aaa\bbb\ccc.js
I tried this:
/${RELATIVE_FILEPATH/((.js))}|/[\\]/${1://}${2://g/}/}
I want to get text like this: /aaa/bbb/ccc
Thank you.
Try this snippet:
"Remove extension and swap to forward slash": {
"prefix": "t2",
"body": [
// "${RELATIVE_FILEPATH}",
"/${RELATIVE_FILEPATH/.js|(\\\\)/${1:+\/}/g}",
],
"description": ""
},
Note the double escapes in .js|(\\\\)
are necessary.
And I added the +
to the ${1:+\/}
.