DEV Community

Discussion on: Hugo - My DOHackathon submission

Collapse
 
geobrodas profile image
Georgey

How did you deploy it I mean I did too using tailwind on the DO cloud but it's showing error 404 since yesterday and it's working fine with GitHub pages too

Collapse
 
szhabolcs profile image
Nagy Szabolcs

Basically I have a src folder, where I import Tailwind and a public folder where I generate my file.
I use PurgeCSS to minify my file size, so my build command looks like this

cross-env NODE_ENV=production npx tailwindcss build src/styles.css -o public/styles.css
Enter fullscreen mode Exit fullscreen mode

If you want to use the very same command you have to have cross-env and purgecss installed from npm.
And after building is finished, I reference the file like so:

  1. public/index.html: styles.css
  2. public/view/index.html: ../styles.css
  3. public/send/index.html: ../styles.css

It's also worth noting that as far as I know, if you have let's say your styles and html inside a folder like so:
public/view/index.html
public/view/styles.css
you can't reference the styles with simply styles.css from the html even tho they are in the same folder. It's best to have all your css and js files in the root of the folder:
Folder structure

I hope this helps, you can check out the GitHub repo if you want too, or send me a message on dev if you have any more questions.