2016-01-18 05:20:08 +08:00
|
|
|
var gulp = require('gulp');
|
|
|
|
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',
|
2017-05-24 18:50:42 +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/'));
|
|
|
|
});
|