You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When installing tailwind using this gem the command is bin/rails tailwindcss:install
Using this command adds necessary configuration files to a rails project.
One of these configuration files is tailwind.config.js
I see there is no option to use a commonjs config file instead.
It would be nice to give an optional flag for the install command such as --config-ext=commonjs to add and use the tailwind.config.cjs file instead.
The commands then would look like this:
bin/rails tailwindcss:install --config-ext=commonjs
bin/rails tailwindcss:build --config-ext=commonjs
bin/rails tailwindcss:watch --config-ext=commonjs
One of the reasons I raise this issue is because the current tailwind.config.js conflicts when using packages that are ESM modules in my project.
For example my package.json needs to have "type":"module" for vite and svelte to work together in my rails project.
There might be another solution to solve my problem.
However, I have forked this repo made some changes and created my own version of this gem which only uses the commonjs configuration and it worked.
I know adding this optional flag would require adding the tailwind.config.cjs in the repo and some changes across different files.
I can create a pull request for this, but wanted to know before doing that if this should be implemented.
The text was updated successfully, but these errors were encountered:
rails
locked and limited conversation to collaborators
Jan 7, 2024
Uh oh!
There was an error while loading. Please reload this page.
When installing tailwind using this gem the command is bin/rails tailwindcss:install
Using this command adds necessary configuration files to a rails project.
One of these configuration files is tailwind.config.js
I see there is no option to use a commonjs config file instead.
It would be nice to give an optional flag for the install command such as --config-ext=commonjs to add and use the tailwind.config.cjs file instead.
The commands then would look like this:
bin/rails tailwindcss:install --config-ext=commonjs
bin/rails tailwindcss:build --config-ext=commonjs
bin/rails tailwindcss:watch --config-ext=commonjs
One of the reasons I raise this issue is because the current tailwind.config.js conflicts when using packages that are ESM modules in my project.
For example my package.json needs to have "type":"module" for vite and svelte to work together in my rails project.
There might be another solution to solve my problem.
However, I have forked this repo made some changes and created my own version of this gem which only uses the commonjs configuration and it worked.
I know adding this optional flag would require adding the tailwind.config.cjs in the repo and some changes across different files.
I can create a pull request for this, but wanted to know before doing that if this should be implemented.
The text was updated successfully, but these errors were encountered: