Configuration
Set up your Yumma CSS project with the CLI.
Initializing configuration file
To create a new yumma.config.js
file in your project, run the following command:
npx yummacss init
pnpm yummacss init
yarn yummacss init
This command will create a new yumma.config.js
file in the root of your project using ESM.
"type": "module"
is set in your package.json
. export default { source: [""], output: "",};
Using CommonJS
If your project does not use ESM, you can use CommonJS instead:
module.exports = { source: [""], output: "",};
Configuration options
The yumma.config.js
file contains several options that you can use to configure the Yumma CSS CLI.
export default { source: [""], output: "", buildOptions: { reset: true, // default: true minify: false, // default: false },};
source
The source array is collection of paths for your project files. This lets the CLI find the Yumma CSS utilities.
export default { source: ["./src/**/*.html"],};
output
The output option is a string that tells where the compiled CSS files should be saved.
export default { output: "./src/styles.css",};
buildOptions.reset
The reset option is a boolean that determines whether the inclusion of the Stylecent reset system. By default, the reset system is included.
export default { buildOptions: { reset: true, // default: true },};
buildOptions.minify
The minify option is a boolean that determines whether the compiled CSS files should be minified. By default, the files are not minified.
export default { buildOptions: { minify: true, // default: false },};
Building and watching
The Yumma CSS CLI provides several commands to help you work with your Yumma CSS files.
Make sure you have a yumma.config.js
file set up before running these commands. If you haven’t, run npx yummacss init
first.
Build
The build
command will compile your Yumma CSS files once.
npx yummacss build
pnpm yummacss build
yarn yummacss build
Watch
The watch
command will watch for changes in your Yumma CSS files and recompile them automatically.
npx yummacss watch
pnpm yummacss watch
yarn yummacss watch