Blame view

build/build-style.js 712 Bytes
7fa943eb   梁灏   init
1
  var gulp = require('gulp');
e2645048   jingsam   :fire: remove tra...
2
  var cleanCSS = require('gulp-clean-css');
7fa943eb   梁灏   init
3
4
  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
           .pipe(autoprefixer({
e2645048   jingsam   :fire: remove tra...
12
              browsers: ['last 2 versions', 'ie > 8']
c058dcb3   jingsam   clean style
13
           }))
e2645048   jingsam   :fire: remove tra...
14
           .pipe(cleanCSS())
7fa943eb   梁灏   init
15
16
17
18
           .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']);