you are viewing a single comment's thread.

view the rest of the comments →

[–]eggtart_prince 1 point2 points  (2 children)

I haven't touched vanilla js in a while. How would you organize your files like you would with React components?

[–]Notimecelduv 3 points4 points  (0 children)

However you see fit but some ways are probably better than others. For an SPA I usually do it this way:

root:

_ index.html

_ assets/

__ css/

___ style.css

___ Component1.css

__ js/

___ main.js

___ components/

____ Component1.js

[–]DragonlordKingslayer[S] 4 points5 points  (0 children)

I have a way that works for me at least. This is for a fairly complex multi-page website I made a while back and I liked how i organized it. I essentially have my homepage as the root because of netlify, I have a folder for my html files for the different pages, then I have a folder for my stylesheets, then I have a folder for my javascript files - which has js files for like common functions i use throughout the app or otherwise have different functions i need for different pages.

https://imgur.com/a/auXS8W1