forked from react-toolbox/react-toolbox
-
Notifications
You must be signed in to change notification settings - Fork 7
/
gulpfile.js
43 lines (38 loc) · 1.01 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
const path = require('path');
const gulp = require('gulp');
const babel = require('gulp-babel');
const postcss = require('gulp-postcss');
gulp.task('js', function () {
return gulp.src([
'./components/**/*.js',
'!./components/**/*.spec.js',
'!./components/**/__test__',
'!./components/__mocks__/**/*.js'
])
.pipe(babel())
.pipe(gulp.dest('./lib'));
});
gulp.task('css', function () {
const plugins = [
require('postcss-import')({
root: __dirname,
path: [path.join(__dirname, './components')]
}),
require('postcss-mixins')(),
require('postcss-each')(),
require('postcss-apply')(),
require('postcss-nesting')(),
require('postcss-reporter')({ clearMessages: true })
];
return gulp.src([
'./components/*.css',
'./components/**/*.css'
])
.pipe(postcss(plugins))
.pipe(gulp.dest('./lib'));
});
gulp.task('tsd', function () {
gulp.src('./components/**/*.d.ts')
.pipe(gulp.dest('./lib'));
});
gulp.task('default', ['js', 'css', 'tsd']);