Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: avoid implicit dependency on tailwind #41

Merged
merged 2 commits into from
Mar 16, 2021

Conversation

pi0
Copy link
Contributor

@pi0 pi0 commented Mar 16, 2021

Normally if tailwind-config-viewer is installed as a dependency, it is expected that tailwind is also installed alongside. But when it is used as a sub-dependency like in @nuxtjs/tailwindcss, package manager might hoist it to top-level node_modules while tailwind dependency will not be hoisted and require cannot work anymore. To avoid such issues we should always explicitly define any imported dependency in dependencies or peerDependencies. (current ranges checked by https://semver.npmjs.com)

This PR also extends require path to first search for tailwind from package (default require behavior) and then fallback to cwd for supporting global install conditions.

Resolves nuxt-modules/tailwindcss#297

@rogden
Copy link
Owner

rogden commented Mar 16, 2021

@pi0 Awesome thanks for the PR. Will merge tonight!

@rogden rogden merged commit ac9c20e into rogden:master Mar 16, 2021
@pi0 pi0 deleted the fix/implicit-tailwind branch March 16, 2021 23:14
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.

Tailwind Viewer doesn't work in 4.0.0/4.0.1
3 participants