loynoir / jsonc-bundler

A bundler for json-with-comments.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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
  }
}

About

A bundler for json-with-comments.


Languages

Language:TypeScript 57.3%Language:JavaScript 42.7%