forked from jquense/react-bootstrap-modal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
66 lines (53 loc) · 1.63 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
'use strict';
var gulp = require('gulp')
, less = require('gulp-less')
, rimraf = require('rimraf')
, plumber = require('gulp-plumber')
, merge = require('merge-stream')
, configs = require('./webpack.configs')
, rename = require('gulp-rename')
, babelTransform = require('gulp-babel-helpers')
, webpack = require('webpack')
, WebpackDevServer = require('webpack-dev-server');
gulp.task('clean', function(cb){
rimraf('./lib', cb);
})
gulp.task('less-compile', ['clean'], function(){
return merge(
gulp.src('./src/less/rbm-complete.less')
.pipe(plumber())
.pipe(less({ compress: true }))
.pipe(gulp.dest('./lib/styles')),
gulp.src('./src/less/rbm-patch.less')
.pipe(plumber())
.pipe(less({ compress: true }))
.pipe(gulp.dest('./lib/styles'))
)
})
gulp.task('less-copy', ['clean'], function(){
return gulp.src('./src/less/*.less')
.pipe(gulp.dest('./lib/styles'))
})
gulp.task('transpile', ['clean'], function(){
return gulp.src(['./src/**/*.jsx', './src/**/*.js'])
.pipe(plumber())
.pipe(babelTransform(
configs.babel
, './util/babelHelpers.js'
, './lib/util/babelHelpers.js'))
.pipe(rename({ extname: '.js' }))
.pipe(gulp.dest('./lib'));
})
gulp.task('docs', function() {
new WebpackDevServer(webpack(configs.dev), {
publicPath: '/docs',
hot: true,
stats: { colors: true }
})
.listen(8080, 'localhost', function (err) {
if (err)
return console.log(err);
console.log('Listening at localhost:8080');
});
})
gulp.task('release', ['clean', 'less-compile', 'less-copy', 'transpile'])