When using oxfmt in a monorepo subdirectory, the experimentalTailwindcss.config paths are resolved inconsistently depending on where the command is run from.
Environment
- oxfmt version: 0.26.0
- Config file location:
frontend/.oxfmtrc.jsonc (subdirectory of monorepo)
- Tailwind config location:
frontend/src/tailwind.config.ts
The Problem
Given this config in frontend/.oxfmtrc.jsonc:
- Locally: Works correctly, resolves to
<root>/frontend/src/tailwind.config.ts
- In CI: Fails, resolves to
<root>/src/tailwind.config.ts (missing frontend/ prefix)
Error Message (CI)
Unable to load your Tailwind CSS v3 config: /home/ci/project/src/tailwind.config.ts
Failed to format file with external formatter: .../Component.module.css
JS formatFile promise rejected for file: 'Component.module.css', parser: 'css': GenericFailure,
Error: Cannot find module '/home/ci/project/src/tailwind.config.ts'
The path is missing the frontend/ subdirectory where both the oxfmt config and tailwind config actually reside.
Expected Behavior
Paths in the config should be resolved relative to the config file location, so ./src/tailwind.config.ts always resolves to <config-dir>/src/tailwind.config.ts regardless of the current working directory.
Workaround
Currently using sed to adjust paths based on environment.
When using oxfmt in a monorepo subdirectory, the
experimentalTailwindcss.configpaths are resolved inconsistently depending on where the command is run from.Environment
frontend/.oxfmtrc.jsonc(subdirectory of monorepo)frontend/src/tailwind.config.tsThe Problem
Given this config in
frontend/.oxfmtrc.jsonc:{ "experimentalTailwindcss": { "config": "./src/tailwind.config.ts" } }<root>/frontend/src/tailwind.config.ts<root>/src/tailwind.config.ts(missingfrontend/prefix)Error Message (CI)
The path is missing the
frontend/subdirectory where both the oxfmt config and tailwind config actually reside.Expected Behavior
Paths in the config should be resolved relative to the config file location, so
./src/tailwind.config.tsalways resolves to<config-dir>/src/tailwind.config.tsregardless of the current working directory.Workaround
Currently using
sedto adjust paths based on environment.