-
Hi, In my custom JSX factory project that uses Vite Vanilla - TypeScript template; If i use .tsx file extension Typescript complaining How to make .tsx also recognize .svg / other image mime module?
{
"compilerOptions": {
"target": "ES2020",
"module": "ESNext",
"useDefineForClassFields": true,
"lib": [
"ES2020",
"DOM",
"DOM.Iterable"
],
"skipLibCheck": false,
/* Bundler mode */
"moduleResolution": "Bundler",
"allowImportingTsExtensions": true,
"isolatedModules": true,
"moduleDetection": "force",
"noEmit": true,
"forceConsistentCasingInFileNames": true,
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
/* JSX */
"jsx": "react-jsx",
"jsxImportSource": "my-jsx-factory",
},
"include": [
"src",
]
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Not sure this is related to Vite. Can you provide a reproduction? I have this with preact and tsc looks happy https://stackblitz.com/edit/vitejs-vite-o2uzfe?file=src%2Frepro.tsx |
Beta Was this translation helpful? Give feedback.
Argh just found what the caused!
It cannot have the sama file name:
main.ts
&main.tsx
rename
main.tsx
to other name solved the issueThank you for your thought @hi-ogawa 😊