risen228 / craco-alias

A craco plugin for automatic aliases generation for Webpack and Jest
MIT License
109 stars 11 forks source link

Cannot parse valid tsconfig that includes comments #35

Open fourpastmidnight opened 3 years ago

fourpastmidnight commented 3 years ago

I'm currently using Craco-Alias v3.0.1.

I had a very simple tsconfig file:

{
  "extends": "mybase.tsconfig.json" , // Not actual filename
  "compilerOptions": {
    "baseUrl": "./",
    "paths": {
        // I actually had a comment in the  file there, because I desire a different path, eventually...
        // and TypeScript supports comments in tsconfig files (JSONC, or JSON with Comments)
        // but Craco-Alias does not   :'(
        "@myscope/*": "./packages/myscope/*"
    }
  }
}

But as you can see from the comment in the file above, Craco-Alias does not support Json with Comments, even though that's technically what tsconfig files are. (As you can see when you do tsc --init—you get a file full of comments with a very basic configuration, and tsc happily consumes it.)