在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):albertorestifo/gulp-gcloud-publish开源软件地址(OpenSource Url):https://github.com/albertorestifo/gulp-gcloud-publish开源编程语言(OpenSource Language):JavaScript 100.0%开源软件介绍(OpenSource Introduction):gulp-gcloud-publish
Install
UsageFirst, you need to create your Google Cloud API credentials. Official Docs. The plugin takes a configuration object with the following keys:
ExampleIf you would like to var gulp = require('gulp');
var gcPub = require('gulp-gcloud-publish');
var gzip = require('gulp-gzip'); // optional
gulp.task('publish', function() {
return gulp.src('public/css/example.css')
.pipe(gzip()) // optional
.pipe(gcPub({
bucket: 'bucket-name',
keyFilename: 'path/to/keyFile.json',
projectId: 'my-project-id',
base: '/css',
public: true,
transformDestination: function(path) {
return path.toLowerCase();
},
metadata: {
cacheControl: 'max-age=315360000, no-transform, public',
}
})); // => File will be uploaded to /bucket-name/css/example.css
}); |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论