Dondada
Dondada

Reputation: 441

How to use Gulp to fetch external javascript files

I'm fairly new to using Gulp, but i've been starting to play around with it and the fact that I can run a server with livereload just by typing 'gulp' makes me wonder where it's been my whole life.

I tend to use CDN's for external libraries but am now working on a project that doesn't allow calls outside the network, meaning I have to include the js files. Is there a way with gulp that will fetch all external javascript files, place it in one single file and minified?

Upvotes: 1

Views: 2845

Answers (1)

Eric Bishard
Eric Bishard

Reputation: 5331

I'm pretty sure you are looking for an asset like this:

gulp-bundle-assets https://www.npmjs.org/package/gulp-bundle-assets

You can also look at these Gulp plugins for help with CDNs:

gulp-s3: With this you can uploads your static files to Amazon S3 at build time.
gulp-google-cdn: This will replace all references to 3rd party libraries with Google CDNs

Upvotes: 2

Related Questions