Skip to content

Add support for tailwind.config.mjs and tailwind.config.mts #13927

@jscarle

Description

@jscarle

What version of Tailwind CSS are you using?

tailwindcss 3.4.4

What build tool (or framework if it abstracts the build tool) are you using?

vue 3.4.31, typescript 5.5.2, vue-tsc 2.0.24, vite 5.3.2

What version of Node.js are you using?

node 22.3.0

What browser are you using?

N/A

What operating system are you using?

Windows

Reproduction URL

https://github.com/jscarle/ReproTailwindCSS

Describe your issue

In preparation for Node 22 and ESM module requirements, I have started converting my projects to use .mts files so that vite transforms them to .mjs files. When building the project with vite using tailwind.config.ts, node generates the following error:

image

If I change the filename to tailwind.config.mts, it no longer finds the configuration.

image

Node 22 documentation

https://nodejs.org/api/esm.html

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions