Skip to content

loynoir/jsonc-bundler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jsonc-bundler

A bundler for json-with-comments.

Use case

Bundle tsconfig.json and preserve comments.

Usage

jsonc-bundler ./examples/extended.jsonc

Example

$ cat examples/tsconfig/base.tsconfig.json
{
    "compilerOptions": {
        // comment from base: esnext
        "module": "esnext",
        "target": "esnext",

        // comment from base: strict for default
        "noUnusedLocals": true,
        "noUnusedParameters": true
    }
}
$ cat examples/tsconfig/extend.tsconfig.json
{
    "extends": "./base.tsconfig.json",
    "compilerOptions": {
        // comment from extend: less strict for ts-node
        "noUnusedLocals": false,
        "noUnusedParameters": false
    }
}

$ cat examples/tsconfig/spec/actual.bundle.tsconfig.json
{
  "compilerOptions": {
    // comment from base: esnext
    "module": "esnext",
    "target": "esnext",
    // comment from extend: less strict for ts-node
    "noUnusedLocals": false,
    "noUnusedParameters": false
  }
}