quasarframework / app-extension-typescript

Add TypeScript to your existing Quasar 1.0 JS project

Home Page:https://quasar.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tsconfig.json error for babel config file

IlCallo opened this issue · comments

An error is reported at tsconfig.json about babel.config.js being overwritten after build or something like that.

This answer explain it's cause, while this reflect our current scenario: it's Quasar app who decide to generate into dist folder, but TS extension doesn't know about this (because it's probably managed at a lower level via Webpack) and complains.

It can be fixed by changing options like this:

{
  "compilerOptions": {
    "allowJs": true,
    "sourceMap": true,
    "target": "es6",
    "strict": true,
    "experimentalDecorators": true,
    "module": "esnext",
    "moduleResolution": "node",
    "baseUrl": ".",
    "outDir": "./dist" // <- Add this
  },
  "exclude": ["node_modules", "dist"] // <- Add "dist" to "exclude" array
}

EDIT
or (preferred, if you are not using this configuration also to directly compile files) like this

{
  "compilerOptions": {
    "allowJs": true,
    "sourceMap": true,
    "target": "es6",
    "strict": true,
    "experimentalDecorators": true,
    "module": "esnext",
    "moduleResolution": "node",
    "baseUrl": ".",
    "noEmit": true // <- Add this
  },
  "exclude": ["node_modules"]
}

Output is managed by Webpack, so we don't really need TypeScript to emit any file.

Add "noEmit": true fix it too. I see this solution here.