Blame view

build/build-style.js 705 Bytes
7fa943eb   梁灏   init
1
2
3
4
  var gulp = require('gulp');
  var minifyCSS = require('gulp-minify-css');
  var less = require('gulp-less');
  var rename = require('gulp-rename');
c058dcb3   jingsam   clean style
5
  var autoprefixer = require('gulp-autoprefixer');
7fa943eb   梁灏   init
6
  
c058dcb3   jingsam   clean style
7
8
  // 编译less
  gulp.task('css', function () {
4b05d84e   梁灏   Modify the direct...
9
       gulp.src('../src/styles/index.less')
7fa943eb   梁灏   init
10
           .pipe(less())
c058dcb3   jingsam   clean style
11
12
13
           .pipe(autoprefixer({
              browsers: ['last 2 versions']
           }))
7fa943eb   梁灏   init
14
15
16
17
18
           .pipe(minifyCSS())
           .pipe(rename('iview.css'))
           .pipe(gulp.dest('../dist/styles'))
  });
  
c058dcb3   jingsam   clean style
19
  // 拷贝字体文件
7fa943eb   梁灏   init
20
  gulp.task('fonts', function () {
4b05d84e   梁灏   Modify the direct...
21
      gulp.src('../src/styles/common/iconfont/fonts/*.*')
7fa943eb   梁灏   init
22
23
24
          .pipe(gulp.dest('../dist/styles/fonts'))
  });
  
c058dcb3   jingsam   clean style
25
  gulp.task('default', ['css', 'fonts']);