jr-cologne / gulp-starter-kit

A simple Gulp 4 Starter Kit for modern web development.
https://www.npmjs.com/package/@jr-cologne/create-gulp-starter-kit
MIT License
167 stars 40 forks source link

Build after each change #9

Closed krystian-cholota closed 5 years ago

krystian-cholota commented 5 years ago

I noticed that during any change, the dist folder is built from scratch, which means that all images are also minified. Could you add a production and development version? I tried but unfortunately it did not work out. Thanks!

jr-cologne commented 5 years ago

Hi @krystian-cholota, thank you very much for raising this issue. What exactly would you expect of a production and development version? It would be nice if you could explain this further. Since this is probably a bigger change, I also need to think about this for some time. However, differentiating between production and development somehow is definitely something I am willing to work on. So, please feel to contribute by sharing your ideas in order to make sure that we are on the same track before I start coding. Thanks and best regards, @jr-cologne

krystian-cholota commented 5 years ago

The starter kit is very good now :) However, you could enter the 'gulp build' command to create a production version. Possibly, the 'cache' plugin in browserify will work, so that when changing a file, the 'dist' folder does not build anew and all files minifi with the pictures. Let me know what you think and maybe there is a quick solution to this :)

jr-cologne commented 5 years ago

Alright, I could imagine implementing a npm run build command. Like you already said, this would just need to execute gulp build to create the production version.

Next, I would need to modify the current script in order to minify images only when starting npm start and then they should get cached so they are not re-minified every time.

Unfortunately, I currently don't have the time to work on this. I hope, this can wait until next weekend. In case it's very urgent, feel free to try implementing this by yourself.

Have a nice day!

jr-cologne commented 5 years ago

Hi @krystian-cholota, I just opened a PR (#10) targeting your issue. Please let me know if the simple solution I came up with is fine for your needs. Thanks for your support, @jr-cologne

krystian-cholota commented 5 years ago

Hi @jr-cologne, Very cool! :) This change is great ;) Thank you!

jr-cologne commented 5 years ago

Alright, thank you for your feedback. I am going to release this in a few minutes. 👍