Skip to content
This repository has been archived by the owner on Oct 22, 2022. It is now read-only.

Latest commit

 

History

History
94 lines (73 loc) · 1.67 KB

README.md

File metadata and controls

94 lines (73 loc) · 1.67 KB



🔧
treeshake-config




Automatic config generation CLI

Package Version Package Monthly Downloads Docs



❓ How does it work

treeshake-config works by importing a "root" config file & all of its exports. For each export it will generate a new .config.js file accordingly.

Example
An example of how `treeshake-config` works:
// config.ts
export const tailwind = {
  media: "class",
};

export const prettier = {
  useTabs: true,
};

Will generate the following files:

// tailwind.config.js
module.exports = {
  media: "class",
};

// prettier.config.js
module.exports = {
  useTabs: true,
};

🚀 Install

Install it locally in your project

npm i --save--dev treeshake-config

# Or with Yarn

yarn add -D treeshake-config

🦄 Usage

Add the cli to your postinstall script in your package.json file:

{
  "scripts": {
    "postinstall": "treeshake-config"
  }
}

Lastly, add *.config.js to your .gitignore file to ignore all generated config files:

# .gitignore
*.config.js