Project Setup and Linking To Tailwind.css Questions #1904
-
Hey, I'm new to Tailwind and frontend development in general and I was curious about how to setup a project for development. In most tutorials on Tailwind, people create a src folder, which contains a css folder with Tailwind.css and then they run a build script which puts everything into a dist or public folder. This folder contains the "compiled" Tailwind.css file. They then add html files to the dist/public folder and link to the css/Tailwind.css file. What is the point of the src folder? Does it only contain the uncompiled Tailwind.css file and all real development is done in dist/public? Or should I write a build script like "build:dev" to compile the Tailwind.css file into src/css and then create all html files in src? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
It's a common folder organization, where you have crude code inside Usually, you'll have some sort of script that will take your code inside In the example you mentioned, as the only piece of your code that needs this kind of transformation is the Tailwind file with the Answering your question, for a small project (where you can count the files by hand), I would put everything in the same folder. A recent project of mine, very similar to you description: https://github.com/estevanmaito/tailwindcss-multi-theme/tree/master/examples/simple |
Beta Was this translation helpful? Give feedback.
It's a common folder organization, where you have crude code inside
src
and ready-for-production code insidedist
.Usually, you'll have some sort of script that will take your code inside
src
, pass it through some plugin, and put the new code insidedist
.In the example you mentioned, as the only piece of your code that needs this kind of transformation is the Tailwind file with the
@tailwind
rules, it seems a bit of overkill to have extra folders just for it, as yourindex.html
doesn't need any special treatment (you're just writing what will appear in the browser).Answering your question, for a small project (where you can count the files by hand), I would put everything in the same fo…