Skip to content
This repository has been archived by the owner on Nov 8, 2021. It is now read-only.

tsconfig.json error for babel config file #36

Closed
IlCallo opened this issue Aug 19, 2019 · 1 comment
Closed

tsconfig.json error for babel config file #36

IlCallo opened this issue Aug 19, 2019 · 1 comment

Comments

@IlCallo
Copy link
Member

IlCallo commented Aug 19, 2019

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.

@IlCallo IlCallo changed the title tsconfig.json error for babel compilation tsconfig.json error for babel config file Aug 19, 2019
@M6stafa
Copy link

M6stafa commented Sep 24, 2019

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

@IlCallo IlCallo closed this as completed Oct 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants