@revved/generate-jsconfig

0.0.2 • Public • Published

Generates a jsconfig.json file from an alias hash

TODOs

  • Automate publish through CI

Setup

  • npm install

Test

  • npm test

To Publish

  • Run npm run release
  • Commit changes
  • Run npm publish

Examples

const { writeJsconfig } = require("@revved/generate-jsconfig");
const aliases = {
    "~root": "./",
    "~lib": "./lib",
    "~config": "./config",
}

const merge = config => {
    config.compilerOptions.target = "es6";

    return config;
};

// __dirname may not be the root if running from a bin folder. Adjust as needed i.e. path.join(__dirname, "../");
writeJsconfig(__dirname, getWebpackAliases(), merge);

Result written to jsconfig.json

{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "~root/*": [
        "api-boomnation/*"
      ],
      "~lib/*": [
        "api-boomnation/lib/*"
      ],
      "~config/*": [
        "api-boomnation/config/*"
      ],
    },
    "target": "es6"
  },
  "exclude": [
    "node_modules",
    "**/node_modules/*"
  ]
}

/@revved/generate-jsconfig/

    Package Sidebar

    Install

    npm i @revved/generate-jsconfig

    Weekly Downloads

    0

    Version

    0.0.2

    License

    ISC

    Unpacked Size

    12.1 kB

    Total Files

    12

    Last publish

    Collaborators

    • mfrr1118
    • addisonk