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

feat(module): HMR support with @nuxtjs/tailwindcss #1665

Merged
merged 10 commits into from
Apr 24, 2024

Conversation

ineshbose
Copy link
Member

@ineshbose ineshbose commented Apr 14, 2024

πŸ”— Linked issue

nuxt-modules/tailwindcss#682

Resolves #1685

Original PR: #1272

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Will work with @nuxtjs/tailwindcss@nightly that is planned to release as 6.12.0 next week (not with 6.11.x due to race conditions and requirement of running prepare beforehand).

This should no longer be a breaking change. If we continue using inline-config with 6.12.0, the module will still work but developers won't be able to take advantage of instant HMR.

src/module.ts Outdated
}
}
})
await installModule('@nuxtjs/color-mode')
Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

I have reverted this for now as I see that a few styles are written for .dark selector (and some devs may have also done it), so we can do this later separately and ship for v3. (#1289, /cc @benjamincanac)

@ineshbose
Copy link
Member Author

6.12.0 has been released

@ineshbose
Copy link
Member Author

ineshbose commented Apr 21, 2024

  • @benjamincanac I leave it up to you to update package.json and pnpm-lock.yaml for @nuxtjs/tailwindcss@6.12.0

@benjamincanac benjamincanac changed the title refactor(module): provide tailwind config through template feat(module): provide tailwind config through template Apr 22, 2024
@benjamincanac
Copy link
Member

@ineshbose Would you know where this CONFIG PROVIDER log comes from? πŸ€”
CleanShot 2024-04-24 at 11 40 27@2x

@ineshbose
Copy link
Member Author

@ineshbose Would you know where this CONFIG PROVIDER log comes from? πŸ€” CleanShot 2024-04-24 at 11 40 27@2x

rogden/tailwind-config-viewer#94

@benjamincanac benjamincanac changed the title feat(module): provide tailwind config through template feat(module): enable HMR by providing tailwind config through template Apr 24, 2024
@benjamincanac benjamincanac changed the title feat(module): enable HMR by providing tailwind config through template feat(module): HMR support for Tailwind CSS Apr 24, 2024
@benjamincanac benjamincanac changed the title feat(module): HMR support for Tailwind CSS feat(module): HMR support with @nuxtjs/tailwindcss Apr 24, 2024
@benjamincanac benjamincanac merged commit 821e15b into dev Apr 24, 2024
2 checks passed
@benjamincanac benjamincanac deleted the chore/tw-config-path2 branch April 24, 2024 10:20
config: { darkMode: 'class' },
configPath: [
configTemplate.dst,
join(nuxt.options.rootDir, 'tailwind.config')
Copy link
Member

Choose a reason for hiding this comment

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

@ineshbose Are you sure this join is valid? Shouldn't it be at least tailwind.config.ts?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it should be fine and resolved here - https://github.com/nuxt-modules/tailwindcss/blob/main/src/resolvers.ts#L17

Any issues being faced?

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.

Nuxt Tailwind warning when running dev
2 participants