gulp-cdn-ref
change urls in css/js files to cdn-based version
install
$ npm i gulp-cdn-ref --save-dev
usage
var gulp=;var replace=; gulp;
and
$ gulp cdnref
See example in test
config object
var config = cdn: 'http://lisposter.b0.upaiyun.com' base: 'assets' map: //...
cdn
: your cdn service url.base
: the root dir of this website.
eg. here is a files tree:
project
├── style
│ └── style.css
├── assets
│ └── images
| └── bg.png
and, here is the css:
so, the config
may be:
var config = cdn: 'http://lisposter.b0.upaiyun.com' base: 'project'
this can make your css like this: