reactjs - nextjs tvinga transpiler es6 till es5 ignorera tsconfig
Nextjs ignorera tsconfig target-alternativet vid kompilering. Es6-klasser och arrow-funktioner transpilieras till funktioner.
När next build skrivs i terminalen
info - Using tsconfig file: ./tsconfig.json
och path-alias orsakar inget fel. Så min tsconfig tillämpas. Men nextjs transkriberar alla arrow functions, klasser, etc
// tsconfig.json
{
"compilerOptions": {
"target": "es2020",
"lib": [
"webworker",
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "Node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"baseUrl": ".",
"paths": {
"@/*": [
"./*"
],
"src/*": [
"src/*"
],
},
"incremental": true
},
"exclude": [
"node_modules"
],
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx"
]
}
