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 it locally in your project
npm i --save--dev treeshake-config
# Or with Yarn
yarn add -D treeshake-config
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