Working with build folders

Every so often, I (have to) use build folders. Never liked working with them, but another issue I came across and was wondering if there is a solution. Working from within the source folder, when I want to upload files I cannot just upload the current file or pick another just edited file, but I need to fiddle those files from the build folder and upload them (one by one).

Since build folders are not that rare, does WebStorm (I am using PhpStorm) have anything to make things easier?

0
12 comments

Please elaborate on the use case. Where do you want to upload files? Do you use "Deployment" feature of the IDE? 

0

Sure, here is what I do. A typical scenario … I work in several files like my index.html the main.css another JS file and perhaps multiple more HTML/PHP files. They all live in a source folder like /source/index.html or /source/css/main.scss etc. And of course there are quite some images in /source/img/partners/logoabc.png or /source/img/main/hero.jpg etc.

So, there are quite a few files I have edited. Since more or less files are going through a build process, the production files will be in /build/index.html or /build/css/main.css /build/img/main/hero.jpg and so on.

While I could upload the full /build/ folder, I prefer to only upload changed files or those I want to. Build folder is often > 10M

Nova has a nice feature, it not only detects there is a “build” folder, but it also shows in an extra panel only changed files and I can click to upload those alone. Not everything.

And yes, I do use PS built in deployment.

0

Sorry, can't see it from the link above. I don't want automatic upload! Or did you mean the part where it says, “Compare with Local Version”?

0

I mean automatic upload. You can configure it to "On explicit save action", so once you hit Cmd+S, all the changed files within mapped folders will be uploaded to remote host. 

Moreover, you can exclude some files by patterns. 

Doesn't that fit your case? 

0

>> Doesn't that fit your case? 

No, unfortunately not at all. First, I don't want things to be uploaded automatically (it is an entirely different story) and second it isn't helpful handling source/build folder.

0

I am not sure if I fully understood your concern but have you tried unticking the "Overwrite up-to-date files" option?When this option is unticked (it's enabled by default), only a new/changed files will be actually uploaded even if you invoke the Upload action for the whole project/directory. Here is how it looks like in the end:

 

Isn't that what are you looking for?

0

My comments are not saved?

0

Ok, the last one worked. 

- - - -

Had posted another comment yesterday, but can't see it. In moderation?

But again, thanks for your effort! Unfortunately, I think this is not a good fit for me. Since my Deployment Local Path is /build/ I can't just upload the file I am currently working with because it is in /source/. Files in that folder can't be uploaded, obviously. So, I have to open the sidebar, look for the file from within the /build/ dir and upload it. Or I have to upload everything. Don't like this either, sometimes I need to just upload some/single files, not all. And, don't want to be rude, but PS has a terribly slow FTP client. OK for a dozen files, but far too slow for complete folders with many files.

Though there are good ways to work with /source and /build folders and though there are a lot more people having same trouble :-) (doesn't react apps, SSG etc. have build folders as well?). 

0

Thank you for your reply. I cannot see any comments that require moderation, strange.

 

Correct me if I am wrong, might be I am missing something, but why have you to upload everything?
If you select the /build/ folder and then invoke "Upload" action, IDE should upload changed files only (if you have enabled the option that I referred previously), isn't it? Or you do not want to upload _all_ _changed_ files from the /build/ folder?

In this case, you may try to invoke the "Sync with deployed" action, it should show you a diff dialog where you can select files to upload.

Also, I remember that you are against the automatic uploads but these should also work fine for the "/build/" folder as well as external changes are also taken into consideration unless "Skip external changes" option is enabled.

 

As for the deployment performance, starting from the 2021.3, it should be possible to use multiple threads, so you may want to play around with this option:
https://youtrack.jetbrains.com/issue/WI-5580/Speed-up-file-transfer-using-multiple-FTP-SFTP-threads#focus=Comments-27-5115105.0-0

 

0

As for the deployment performance, starting from the 2021.3, it should be possible to use multiple threads, so you may want to play around with this option:

PS is still one of the slowest ftp clients I have ever used, but did give it another try:

[15.12.22, 17:42] Upload to webdevelopment-login completed in 11 min, 32 sec: 2,345 files transferred, 4 items failed (18.7 kbit/s)

Used Transmit, and it took only 3 min 43 sec. So, PS is 3 x slower! :( 

0

Thank you for coming back.

Did you notice any slowness on the "Collecting Files" phase?
How many threads have you tried to set?

0

Please sign in to leave a comment.