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

Multiple-project support #84

Open
BigPaul opened this issue Nov 3, 2024 · 1 comment
Open

Multiple-project support #84

BigPaul opened this issue Nov 3, 2024 · 1 comment

Comments

@BigPaul
Copy link

BigPaul commented Nov 3, 2024

I've been using this extension for a while now and I've found it very useful. Thanks for sharing your work.

I'm now trying to add support to a different project in the same solution. The second project will have different classes and less of them, but I haven't been able to find a way to do this. At the moment, changes to any one of the two input files pushes the changes to both output files.

It seems that there can only be 1 tailwind.config.js defined in the tailwind.extension.json and only 1 tailwind.extension.json file in the project.

Is this scenario supported? I'm quite new to tailwind, so maybe there's something I can do with the tailwind config?

@theron-wang
Copy link
Owner

Glad you're enjoying the extension.

Unfortunately, as you pointed out, the extension only works with one tailwind.config.js in the entire solution. Depending on how different your configuration files are (i.e. plugins, prefixes, etc.), there may be some workarounds.

For building, you can use @config in your css files, which allows you to specify the correct Tailwind configuration file to your input css file and classes should build properly if you link your input and output files in the tailwind.extension.json file. This approach works best if your theme values/plugins are the same in your Tailwind configuration files (different contents will work), but builds will still work if they are not. As for setting your tailwind.config.js file, you can choose any file; it is only used to determine classes for non-build features like IntelliSense or linting.

Hopefully this helps - if you are still running into any issues, please let me know! I'll try to add support for this in the future, and we can keep this issue open until I do.

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

No branches or pull requests

2 participants