CartoAssets/Gulpfile.js

29 lines
679 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() {
2016-01-23 01:45:23 +08:00
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();
});
};
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',
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/'));
});