Browserify-cdn
Browserify tranform to use require() loading resources from jsDelivr.
Usage
; // Transforms to: ;
- Recognizes if the required file name contains a .cdn extension.
- Check if the required library is already downloaded.
- Transforms the required file name to the relative path of the downloaded library.
- If isn't downloaded, checks if the required library exists on jsdelivr.com.
- Downloads the latest mainfile of the library into the .cdncache directory via this url:
https://cdn.jsdelivr.net/<library>/latest/mainfile
- Transforms the required file name to the relative path of the downloaded library.
Install
npm install browserify-cdnjs
Usage in your build script
// gulpfile.js var cdnjs = ; ;