I'm trying to create a TypeScript snippet in Visual Studio Code which includes a bunch of import statements, but I want the path to be set dynamically depending on which directory you use the snippet.
For example, I have a snippet like this:
import { MyComponent } from "../../ui/components";
import { isString } from "../../../../utils/string";
export const Foo = (props) => {
const isStr = isString(props.foo);
/* ...More code... */
return <MyComponent></MyComponent>;
};
How can I make sure that the import paths are set relative to the direcotry I execute the snippet? If this is not possible, are there any other ways you would recommend for achieving this?