1

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?

2
  • Haven't tried to do this myself, but it seems like gulp-asset might be kinda what you're looking for. Not sure if it actually downloads the files for you though. Commented Nov 24, 2014 at 19:39
  • It's basic bundling and minification. Please review the answer below and let us know if this meets your requirements! Glad to try and help.. Commented Nov 25, 2014 at 0:57

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

3 Comments

I gotta leave work soon, let me know if this is what you are looking for. If not please tell me any short comings and I'll see what else I can find or come up with.
I'm not understanding how to write the bundle config file. All the scripts are coming from an external cdn.
I believe that your answer is here, you have not posted any code that you have written or given us any idea of what you are trying to write. Unless more information is given I can only give you a vague answer. Please mark the answer correct if the information helps you solve your problem or post some more info.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.