Thank you for taking the time to contribute to lightningcss-build.
lightningcss-build has adopted the
Contributor Covenant as its Code of
Conduct, and we expect project participants to adhere to it. Please read
the full text so that you can understand what actions will
and will not be tolerated.
Open an issue at https://github.com/igordanchenko/lightningcss-build/issues. Please include:
- Node version (
node --version). - A minimal repro — ideally the
lightningcss-buildcommand, thesrc/tree, and the observed vs. expected output. - For watch-mode issues, the sequence of edits that triggered the bug.
For security issues, do not open a public issue — see
SECURITY.md.
- For non-trivial changes, open an issue first to align on the approach.
- Fork the repository and create a topic branch from
main. - Add tests for any behavior changes.
- Run
npm run cilocally — it must pass before you submit. - Open a PR, link the issue if applicable, and describe what changed and why.
git clone https://github.com/igordanchenko/lightningcss-build.git
cd lightningcss-build
npm install| Script | Purpose |
|---|---|
npm test |
Run the Vitest suite |
npm run lint |
Run ESLint |
npm run ci |
Lint + test |
To run a single test file or match by name:
npx vitest run test/build.test.js
npx vitest run -t "name substring"Commits must follow
Conventional Commits. commitlint runs
on every commit via Husky and will reject messages that don't conform.
Prefer narrow, focused commits — semantic-release derives the version bump and changelog entry from each commit's type and body.
Common types: feat, fix, docs, test, refactor, chore, ci, build.
- ESLint and Prettier run on staged files via
lint-staged. You normally don't need to run them manually — the pre-commit hook formats and fixes on its own. - If a hook fails, fix the reported issue and re-stage rather than bypassing
with
--no-verify.
The test suite spawns the real CLI via child_process.spawn against
bin/cli.js in a temporary directory. This is intentional — it exercises argv
parsing, exit codes, and stderr formatting the same way a user would.
When adding behavior, prefer adding a test that drives the CLI end-to-end over a
unit test against an internal helper. See test/helpers.js for the
temp-directory and watcher helpers (startWatcher, waitFor).
Releases are automated by
semantic-release on
merges to main. You do not need to bump the version or edit CHANGELOG.md.
By contributing code to this repository, you agree to license your contributions under the project's MIT License.