When getting started with nuxt 3, it creates TypeScript project by default. Is there a way to move to JavaScript?
I have tried:
nuxt.config.ts to nuxt.config.jstsconfig.jsonjsconfig.jsonContents of nuxt.config.js
export default {
};
contents of package.json
{
"private": true,
"scripts": {
"dev": "nuxi dev",
"build": "nuxi build",
"start": "node .output/server/index.mjs"
},
"devDependencies": {
"nuxt3": "latest"
}
}
Still the .nuxt folder creates TypeScript files

No, unfortunately in the current nuxt3 version (3.0.0-27268729.5b8e10f), there is no configuration to disable the output of those type declaration files.
While the generated .d.ts file are intended to help TypeScript developers, Nuxt does not require app source to be written in TypeScript. The .d.ts files should have no impact on your JavaScript development other than the slight delay in generating those files.
You can add in file tsconfig.json:
{
"extends": "./.nuxt/tsconfig.json",
"compilerOptions": {
"allowJs": true
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With