tailwindcss/packages/@tailwindcss-node/src
Jordan Pittman cdc851d3f8
Don't inline all env vars in Standalone CLI (#19391)
Fixes #19389

We inlined env vars in the Standalone CLI because we use some custom
patches + env vars to ensure that only the appropriate `glibc` / `musl`
binaries are included for Lightning CSS and Parcel Watcher for Linux
builds.

The build happens to run on a macOS Github CI machine though so
`NODE_PATH` was getting inlined as the string:
```
/Users/runner/work/tailwindcss/tailwindcss/node_modules/.pnpm/bun@1.3.0/node_modules/bun/bin/node_modules
```

I don't think there's a reason for `NODE_PATH` to work on the Standalone
CLI (and it didn't work because of the above bug *anyway*) so I've done
a few things here:
1. The build setup now uses `Bun.build(…)` which now supports compiling
binaries. This speeds up the build process a bit.
2. We're no longer inlining all env vars. We selectively inline only a
few using `define`.
3. I've explicitly disabled the extra `NODE_PATH` support in
`@tailwindcss/node` when building with the Standalone CLI.
4. The `__tw_readFile` hack is now gone. Async FS APIs were not
originally able to read embedded files but that changed in Bun v1.2.3
making the hack unnecessary.
5. A few more env vars are now inlined + a plugin to simplify the Oxide
loading code when bundled.
6. A plugin + env vars prevents bundling WASI build as it's not
necessary for the Standalone CLI.

I want to find a way to get rid of `__tw_resolve` and `__tw_load` but
don't want to change too much in this PR so I haven't looked into it
yet.
2025-12-08 11:23:20 -05:00
..
compile.ts Don't inline all env vars in Standalone CLI (#19391) 2025-12-08 11:23:20 -05:00
env.ts fix: allow process.env.DEBUG to be a boolean in @tailwindcss/node (#18485) 2025-07-11 11:51:50 -04:00
esm-cache.loader.mts Support loading config files via @config (#14239) 2024-09-02 18:03:16 +02:00
get-module-dependencies.ts Support loading config files via @config (#14239) 2024-09-02 18:03:16 +02:00
index.cts Add support for source maps (#17775) 2025-05-08 16:29:49 -04:00
index.ts Add support for source maps (#17775) 2025-05-08 16:29:49 -04:00
instrumentation.test.ts Improve debug logs (#15303) 2024-12-11 15:27:20 +01:00
instrumentation.ts Ensure Symbol.dispose and Symbol.asyncDispose are available (#15404) 2024-12-16 14:17:44 +01:00
normalize-path.ts Resolve @import in core (#14446) 2024-09-23 17:05:55 +02:00
optimize.ts Suppress warnings when using :deep, :slotted and :global (#19094) 2025-10-09 11:58:51 +02:00
require-cache.cts Support loading config files via @config (#14239) 2024-09-02 18:03:16 +02:00
source-maps.ts Add support for source maps (#17775) 2025-05-08 16:29:49 -04:00
urls.test.ts Vite: Don't rebase urls that appear to be aliases (#16078) 2025-01-31 15:23:32 +01:00
urls.ts Generalize the walk implementation (#19126) 2025-10-15 21:28:12 +02:00