NativeScript/tailwind

Tailwind only works if "app" folder exists

Closed this issue · 2 comments

I looked at this issue but I'm not sure if it's related. I had been trying to integrate Tailwind into my NS 8.6.x project with no luck. I think it's scanning a hard-coded "app" folder for TW CSS class references and only bundling what it finds. Any XML files that exist outside of the "app" folder are not scanned and bundled with the TW CSS. I have two identical projects except the code folder named "app" (working) and "src" (broken). I've also tried naming the folder "app2" and it fails too. You can actually have both folders but only classes found in the "app" folder will be available in the "src" TW references.

WORKING demo using "app" folder

BROKEN demo using "src" folder

If it is hard-coded, at least update the README.md to avoid future issues and headaches. Ideally, it's set to scan all folders for TW references.

BTW, the NS CLI creator puts code into the "src" folder, not the "app" folder which created my problem. E.g. ns create new-project-ts --template @nativescript/template-drawer-navigation-ts.

The folder can differ between templates, you can change the tailwind.config.js to look for classes in any folder, the readme is an example using the app folder, but you are free to change that to wherever your files are.

image

Thank you. Please close this issue. I'll look at the README.md file and update with some wording for those who just copy /paste the config file.