Directory tree:
.
├── package.json
├── src
│ ├── entrypoint.tsx
│ ├── index.html
│ └── ui
│ ├── App.tsx
│ └── shared
│ └── Reset.ts
├── start.sh
└── tsconfig.json
TypeScript's tsconfig.json sets paths to
Parcel's ~ module resolution convention
and baseUrl to src directory.
Parcel is given src/index.html as its input,
which references src/entrypoint.tsx.
All TypeScript files in src
may use the ~ non-relative import paths.
{ "compilerOptions": { "target": "ES2019", "lib": [ "dom", "dom.iterable", "esnext" ], "allowJs": true, "skipLibCheck": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true, "strict": true, "forceConsistentCasingInFileNames": true, "module": "esnext", "moduleResolution": "node", "resolveJsonModule": true, "isolatedModules": true, "noEmit": true, "jsx": "react", "baseUrl": "./src", "paths": { "~/*": ["./*"] }, }, "include": [ "src/**/*", "@types" ] }That's how I've got my tsconfig set up. The baseUrl and paths are set up correctly.