My code is not unsafe(-eval)

I was working on a project this week when I came across something which confused me, and that was the following error in my browser console… Refused to evaluate a string as JavaScript because ‘unsafe-eval’ is not an allowed source of script in the following Content Security Policy directive: ‘self’ In itself, not massively odd.  I…

Minifying (or uglifying) javascript

Totally in keeping with my New Year’s Resolution, here is a lovely new blog post!  And it’s a continuation of my new development process.  The last post in the series detailed my switch to using pump instead of pipe in my Gulp task. Today’s post is about minifying javascript, which is sometimes called “uglifying”.  The reason being that this…

Using pump instead of pipe

One thing that I quickly discovered whilst using Gulp to automate my development process, was the piping the results through from one plugin to another could often go wrong, and it was often hard to trap the reason and get proper error messaging out. Then I discovered some example code which pointed me to pump:…

Adding Browserify into the mix

Having already written my first gulp task, I was ready to get a bit more advanced. My first task was to concatenate javascript files, including putting my local version of jQuery in front of my own javascript, so there was a single file to download, with all the required plugins before. However, I’d already heard…

First Gulp task – concatenation

I recently started using a new development process, using Gulp to automate development tasks. I thought I’d start off easy, so I’d concatenate my existing javascript files into a single file. You might ask, why would you want to do this? And my answer would be, you want to reduce the number of items fetched…