Skip to content

Conversation

@unshame
Copy link

@unshame unshame commented Nov 15, 2025

Description

Fix #701

Should I try adding a test for this? It would be way more complicated than the tailwind tests I currently see in the repo. I can try adding a new playground for tailwind 4 and test this there.

Additional context


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the PR Title Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

Comment on lines 344 to 348
if (m1.type !== m2.type) {
if (m1.type === 'js' || m2.type === 'js') {
return m1.type === 'js' ? -1 : 1
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Instead of sorting the modules here, I think we can filter out the non-js modules in the .filter above.

.filter((m) => m.type === 'js' && (!/type=/.test(m.url) || /type=script/.test(m.url)))

Further more, I think we should a add the same condition to other places that uses modules variable. I think we should add jsModules variable that has m.type === 'js' modules and use that instead.

Copy link
Author

@unshame unshame Nov 17, 2025

Choose a reason for hiding this comment

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

Added the filtering in two places where I found modules being used.

I'm assuming the places where style, template and custom blocks are being handled should not have this condition added?

@sapphi-red sapphi-red added feat: hmr p3-minor-bug 🔨 An edge case that only affects very specific usage (priority) labels Nov 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat: hmr p3-minor-bug 🔨 An edge case that only affects very specific usage (priority)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HMR doesn't pick up modules outside of root if tailwind is installed

2 participants