Closed fdx-kunal closed 8 months ago
You don't need to specify an absolute path, but Quokka does run from your project root for unsaved files. This means that the file name will need to be relative to the project working directory.
For example, if your interface is in:
<rootDir>/src/ISomeInterface.ts
Then your import for an unsaved file will need to be:
import { ISomeInterface } from "./src/ISomeInterface.ts";
If you're not already familiar with tsconfig.json
paths setting, you may find that a more useful way to reference your imports. With the paths setting, you will be able to consistently import your imports from all files (vs. relative paths). Please note that this may have a downstream impact on your build / bundling tools, so you will need to evaluate if this works for your specific project.
Issue description or question
When creating a new typescript file how can I import files from the project directory without using an absolute path.
Sample code
Quokka.js Console Output
Code editor version
Visual Studio Code v1.87.2?
OS name and version
Windows