Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Gulp Basics Gulp your JavaScript Workflow Using Third Party Gulp Libraries

How to concat js files linked through CDN or npm install jquery?

In the example, concat is used on local jquery file, how would you concat files used through cdn or package is installed through npm or bower?

1 Answer

Seth Kroger
Seth Kroger
56,413 Points

For files from a CDN: You don't. The whole purpose of a CDN is to rely on a fast service to deliver the files for you and to use locally cached copies of standard libraries/modules/etc. like jquery so they don't need to be transferred if they're already loaded. Trying to concat it with other files on your server to deliver yourself defeats the purpose of using a CDN.