Moving nuxt 3 to JavaScript from TypeScript

Viewed 1801

When getting started with nuxt 3, it creates TypeScript project by default. Is there a way to move to JavaScript?

I have tried:

  1. Rename nuxt.config.ts to nuxt.config.js
  2. delete tsconfig.json
  3. add jsconfig.json

Contents 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

enter image description here

1 Answers

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.

Related