Summary
crosswind build --config ./crosswind.config.ts fails with Cannot find module because the --config path is resolved relative to the CLI's own install dir (node_modules/@cwcss/crosswind/dist/cli.js), not the current working directory. The --help example crosswind build --config ./custom.config.ts is therefore broken. Two related problems compound it (#2, #3 below), so in practice there's no working way to build CSS from a project's config.
Environment
@cwcss/crosswind 0.2.4
- Bun 1.3.13, macOS
Reproduction
From a project root containing crosswind.config.ts:
1. Relative --config (the documented form) → fails:
$ bunx crosswind build --config ./crosswind.config.ts
❌ Failed to load config file: ./crosswind.config.ts
error: Cannot find module './crosswind.config.ts' from '.../node_modules/@cwcss/crosswind/dist/cli.js'
The path is resolved from the package's dist/, not cwd.
2. No --config → config is not auto-discovered:
$ bunx crosswind build
📝 Output: ./dist/crosswind.css
It ignores the cwd crosswind.config.ts (which sets output: ./public/assets/crosswind.css, plus content/theme/shortcuts) and uses defaults.
3. Absolute --config → loads, but the build then crashes:
$ bunx crosswind build --config "$(pwd)/crosswind.config.ts"
🚀 Building CSS...
❌ Build failed: ... @keyframes pulse { ... }
(The config has a pulse safelist entry — possibly a separate keyframes-handling issue, but it means even the absolute-path workaround doesn't produce CSS.)
Expected
--config ./crosswind.config.ts resolves relative to cwd (so the documented --help example works).
crosswind build (no flag) auto-discovers crosswind.config.ts in cwd and honors its output/content/theme/shortcuts/safelist.
Impact
There's no working CLI path to generate a stylesheet from a project's crosswind.config.ts; projects are forced to rely on a dev-server JIT pass instead.
Summary
crosswind build --config ./crosswind.config.tsfails withCannot find modulebecause the--configpath is resolved relative to the CLI's own install dir (node_modules/@cwcss/crosswind/dist/cli.js), not the current working directory. The--helpexamplecrosswind build --config ./custom.config.tsis therefore broken. Two related problems compound it (#2, #3 below), so in practice there's no working way to build CSS from a project's config.Environment
@cwcss/crosswind0.2.4Reproduction
From a project root containing
crosswind.config.ts:1. Relative
--config(the documented form) → fails:The path is resolved from the package's
dist/, not cwd.2. No
--config→ config is not auto-discovered:It ignores the cwd
crosswind.config.ts(which setsoutput: ./public/assets/crosswind.css, pluscontent/theme/shortcuts) and uses defaults.3. Absolute
--config→ loads, but the build then crashes:(The config has a
pulsesafelist entry — possibly a separate keyframes-handling issue, but it means even the absolute-path workaround doesn't produce CSS.)Expected
--config ./crosswind.config.tsresolves relative to cwd (so the documented--helpexample works).crosswind build(no flag) auto-discoverscrosswind.config.tsin cwd and honors itsoutput/content/theme/shortcuts/safelist.Impact
There's no working CLI path to generate a stylesheet from a project's
crosswind.config.ts; projects are forced to rely on a dev-server JIT pass instead.