CartoAssets/Gulpfile.js

30 lines
713 B
JavaScript
Raw Normal View History

2016-01-18 05:20:08 +08:00
var gulp = require('gulp');
var iconfont = require('gulp-iconfont');
var iconfontCss = require('gulp-iconfont-css');
2016-01-20 19:58:47 +08:00
String.prototype.toCamelCase = function() {
var str = this.replace('--', '');
return str.replace(/^([A-Z])|\s(\w)/g, function(match, p1, p2, offset) {
if (p2) return p2.toUpperCase();
return p1.toLowerCase();
});
};
2016-01-18 05:20:08 +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',
2016-01-22 18:53:57 +08:00
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/'));
});