Skip to content

Take NODE_PATH into account when resolving modules#16274

Merged
philipp-spiess merged 2 commits intomainfrom
fix/node-path-env
Feb 5, 2025
Merged

Take NODE_PATH into account when resolving modules#16274
philipp-spiess merged 2 commits intomainfrom
fix/node-path-env

Conversation

@philipp-spiess
Copy link
Contributor

@philipp-spiess philipp-spiess commented Feb 5, 2025

Fixes #15847

This PR changes the node specific resolver config to takes the eventual NODE_PATH env into account.

Test plan

See #15847

Screenshot 2025-02-05 at 12 58 20

@philipp-spiess philipp-spiess requested a review from a team as a code owner February 5, 2025 12:00
Copy link
Member

@RobinMalfait RobinMalfait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet! Can you add a changelog entry?

@philipp-spiess
Copy link
Contributor Author

Can you add a changelog entry?

Yes sir this is indeed part of my set of abilities.

@philipp-spiess philipp-spiess merged commit 3f8e764 into main Feb 5, 2025
5 checks passed
@philipp-spiess philipp-spiess deleted the fix/node-path-env branch February 5, 2025 15:21
@SteffenDE
Copy link

It looks like this does not work in the standalone CLI, is that expected?

$ NODE_PATH=_build/dev/ npx @tailwindcss/cli --cwd assets/ --config tailwind.config.js -i css/app.css --output ../priv/static/assets/app.css
≈ tailwindcss v4.1.7

Done in 32ms

vs

$ NODE_PATH=_build/dev/ ~/Downloads/tailwindcss-macos-arm64 --cwd assets/ --config tailwind.config.js -i css/app.css --output ../priv/static/assets/app.css
≈ tailwindcss v4.1.7

Error: Can't resolve 'colocated_svgs/index.css' in '/Users/steffen/oss/colocated_demo/assets/css'

SteffenDE added a commit to SteffenDE/tailwindcss that referenced this pull request Jan 29, 2026
also allows to pass a path with separator

References tailwindlabs#19391.
References tailwindlabs#16274.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[V4] new import style doesn't work for node_modules in non-standard location (e.g. gradle)

3 participants