Jump to content

Where to make the root of frontend development stuff


Ivan Gretsky
 Share

Recommended Posts

Good day everyone!

There was some talk about using frontend development technologies like node and gulp and bower with PW. I actually started to incorporate them in my workflow on the latest projects. But I did not make a conscious decision on where to put the root of all my frontend dev ops in the PW folder structure.

My first intention was to put my package.json, gulpfile.js and bower.json in the templates folder. Jonathan Lahijani suggested doing so in his epic video. So I've done. But it always looked messy to have node_modules, bower_components, .sass-cache and all the little .json files in there. But now I have a bigger problem - all those files seem to cause errors when running "Translate files" in languages.

So I decided to rethink this. Do I really have to put all that stuff in templates folder? Should I put them in site or even in the root folder? That are benefits and downsides of each option? Are there any possible collisions in multisite installations?

I ask you to share your experience and thoughts on the topic.

  • Like 1
Link to comment
Share on other sites

I'd the same problem with my composer files and ultimately decided to put everything into the site folder, whereas the templates folder should only hold things that really belong there (php files and compiled js / css files). I found this to be most in line with the already present structure of things. site/ does hold all site specific data and package.js and other files are configuration like config.php. 

  • Like 2
Link to comment
Share on other sites

I don't have much recent experience but Like LostKobrakai i used to put that kind of stuff in the site folder, which i consider the root of a project. I only use the templates folder for final production files. So i usually have something like site/src with all css/scss/less/js  source files and then build into the templates folder and sub-folders.

I'm not familiar with multi site so i don't know about the pros and cons there.

  • Like 1
Link to comment
Share on other sites

...i used to put that kind of stuff in the site folder, which i consider the root of a project...

This is what I've been thinking about. There are things like .htaccess that go to root but are still closely related to a project. On the other side there may be more than one template folders in one site directory with some different design... I guess I am still thinking in a "installable template" kind of way.

Maybe the ideas presented here The Wire Render Pattern by @cclsource ould help you decide?

Camilo is talking about something different - code organization in templates folder - but it was an amazing read. I am using a quite a similar pattern.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...