Open arisawali2014 opened 5 days ago
Hello @arisawali2014 .
Yes, you can. MingleJS doesn't interfere with that. TSX config should be at Vite level.
I actually don't use TSX, so I installed a typical Laravel app with Vite + React in TSX, using the default installer. This is what it looks it's needed, find below, screenshot and contents:
package.json
...
"build": "tsc && vite build"
(....)
"dependencies" : {
(....)
"@types/node": "^18.13.0",
"@types/react": "^18.0.28",
"@types/react-dom": "^18.0.10",
"@vitejs/plugin-react": "^4.2.0",
"laravel-vite-plugin": "^1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"typescript": "^5.0.2",
"vite": "^5.0"
(...9
...
ts-config.json
{
"compilerOptions": {
"allowJs": true,
"module": "ESNext",
"moduleResolution": "bundler",
"jsx": "react-jsx",
"strict": true,
"isolatedModules": true,
"target": "ESNext",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"paths": {
"@/*": ["./resources/js/*"],
"ziggy-js": ["./vendor/tightenco/ziggy"]
}
},
"include": ["resources/js/**/*.ts", "resources/js/**/*.tsx", "resources/js/**/*.d.ts"]
}
Can we use TSX other than jsx? for creating components?