0.1.1 • Published 3 years ago

treeshake-config v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

❓ 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.

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