cloudflare plugin for gulp
First, install gulp-cloudflare
as a development dependency:
npm install --save-dev gulp-cloudflare
Then, add it to your gulpfile.js
:
var cloudflare = require("gulp-cloudflare");
gulp.task('purge-cdn-cache', function() {
var options = {
token : 'token',
email : 'email',
domain : 'domain'
};
cloudflare(options);
})
Type: String
Required: true
Type: String
Required: true
Type: String
Required: true
Type: Boolean
Required: false
Type: String
Required: false
Default: fpurge_ts
Possible Values: fpurge_ts
, devmode
This package will only purge the cache from cloudflare. If you want to purge the cache in production mode. Then use https://www.npmjs.com/package/yargs.
gulp --type production
var cloudflare = require("gulp-cloudflare");
var argv = require('yargs').argv;
gulp.task('purge-cdn-cache', function() {
var options = {
token : 'token',
email : 'email',
domain : 'domain',
action : 'fpurge_ts',
skip : argv.type !== 'production'
};
cloudflare(options);
})