CartoAssets/Gulpfile.js

37 lines
930 B
JavaScript
Raw Normal View History

2016-01-18 05:20:08 +08:00
var gulp = require('gulp');
var rename = require("gulp-rename");
2016-01-18 05:20:08 +08:00
var iconfont = require('gulp-iconfont');
var iconfontCss = require('gulp-iconfont-css');
2017-05-24 19:07:21 +08:00
String.prototype.toCamelCase = function () {
return this.replace(/^([A-Z])|\s(\w)/g, function (match, p1, p2, offset) {
2016-01-20 19:58:47 +08:00
if (p2) return p2.toUpperCase();
return p1.toLowerCase();
});
};
2017-05-24 19:07:21 +08:00
gulp.task('default', function () {
2016-01-18 23:31:43 +08:00
gulp.src(['./icon-font/svgs/*.svg'])
2016-01-18 05:20:08 +08:00
.pipe(iconfontCss({
fontName: 'cartoIcon',
2016-01-18 23:31:43 +08:00
path: './icon-font/template.jst.ejs',
targetPath: '../scss/_cdb-icon-font.scss',
2016-01-18 05:20:08 +08:00
fontPath: '../../fonts/'
}))
.pipe(iconfont({
fontName: 'cartoIcon',
2016-01-18 23:31:43 +08:00
appendCodepoints: true
2016-01-18 05:20:08 +08:00
}))
.pipe(gulp.dest('src/fonts/'));
gulp
.src('./node_modules/perfect-scrollbar/src/css/*')
.pipe(rename(function (path) {
path.basename = '_' + path.basename;
}))
.pipe(gulp.dest('./src/scss/vendor/perfect-scrollbar'));
2016-01-18 05:20:08 +08:00
});