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

NuroDev/treeshake-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation



🔧
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

About

🔧 Automatic config generation CLI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published