Skip to content

crosswind build --config <relative path> fails — config resolved from CLI install dir, not cwd #15

@glennmichael123

Description

@glennmichael123

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions