gulp-requirejs-cdnbundler
A require-bundler plugin for gulp.
Apart from normal bundling, this plugin also adds a require.config call to the final optimized script in which all paths are re-added that where removed from the build by using "empty:" during optimization.
Thanks to @SteveSanderson for the original gulp-requirejs-bundler and all his other great work!
Usage
First, install gulp-requirejs-cdnbundler
as a development dependency:
npm install --save-dev gulp-requirejs-cdnbundler
Then, add it to your gulpfile.js
(example):
var require-bundler = ; gulp;
API
require-bundler(requireJsRuntimeConfig, requireJsOptimizerConfig)
Takes two arguments:
- the requirejs config
- the r.js optimizer config
See requirejs config docs and requirejs optimization docs for possible options.