Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

optional flag to use commonjs configuration when installing #256

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

Closed
emerson-argueta opened this issue Mar 9, 2023 · 0 comments
Closed

Comments

@emerson-argueta
Copy link

emerson-argueta commented Mar 9, 2023

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.

@rails rails locked and limited conversation to collaborators Jan 7, 2024
@flavorjones flavorjones converted this issue into discussion #310 Jan 7, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant