From c2c526da172ae216843a3d7af98ef3b1b5047479 Mon Sep 17 00:00:00 2001 From: yulixing Date: Mon, 24 Jun 2019 15:07:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=93=E5=8C=85=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gulpfile.babel.js | 39 ++++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/gulpfile.babel.js b/gulpfile.babel.js index faa58e2..c33f947 100644 --- a/gulpfile.babel.js +++ b/gulpfile.babel.js @@ -1,18 +1,31 @@ -'use strict'; -import gulp from 'gulp'; -import babel from 'gulp-babel'; -import sourcemaps from 'gulp-sourcemaps'; +'use strict' +import gulp from 'gulp' +import babel from 'gulp-babel' +import sourcemaps from 'gulp-sourcemaps' const compileCode = function() { - return gulp.src(['src/**/*']) - .pipe(sourcemaps.init()) - .pipe(babel({ - presets: ['node8'], - })) - .pipe(sourcemaps.write('.')) - .pipe(gulp.dest('lib/')); -}; + return gulp + .src(['src/**/*', '!src/fonts/*']) + .pipe(sourcemaps.init()) + .pipe( + babel({ + presets: ['node8'], + }) + ) + .pipe(sourcemaps.write('.')) + .pipe(gulp.dest('lib/')) +} + + +const copyFont = function() { + return gulp.src(['src/fonts/*']).pipe(gulp.dest('lib/fonts/')) +} + + +gulp.task('compile', compileCode) +gulp.task('copy', copyFont) -gulp.task('default', compileCode); \ No newline at end of file + +gulp.task('default', ['compile', 'copy'])