Fix bug with import statements using single quotes #114
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The code to check if it contains modern tailwind variant is a bit brittle. My prettier overwrites the double quotes in CSS files with single quotes, and after that it won't detect it no more. Then no bundle is generated, I have now made it a litte bit less strict so it can contain both " and ', and also will not break if an extra space is added or not.
I have changed a bit of code so that the add function only creates the import and the bundler will do the installation. The code is a bit convoluted if I may say so, so maybe something else broke again, or not work as expected. The old code also read the css file twice, which is not very efficient.
In the components code I didn't find anything related to the flag
detect_tailwind
so maybe that is an existing bug (or works as expected).Wouldn't a better name for that flag maybe be bundle_tailwind? Because that is what you either want or not want to do.
Fixes #113