-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
62 lines (53 loc) · 1.52 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
const gulp = require('gulp');
const babel = require('rollup-plugin-babel');
const rollup = require('rollup-stream');
const source = require('vinyl-source-stream');
const header = require('gulp-header');
const pkg = require('./package.json');
const postcss = require('gulp-postcss');
const postcssImport = require("postcss-import");
const potscssCssNext = require("postcss-cssnext");
const banner = `/**
* ${pkg.name} - ${pkg.description}
* @version v${pkg.version}
* @license ${pkg.license}
* @repository ${pkg.repository.url}
*/
`;
const distPath = './dist';
gulp.task('datepicker', () => {
return rollup({
entry: './src/scripts/index.js',
format: 'umd',
moduleName: 'callie',
plugins: [ babel() ],
})
.pipe(source('index.js'))
.pipe(header(banner, { pkg } ))
.pipe(gulp.dest(distPath));
});
gulp.task('library', () => {
return rollup({
entry: './src/scripts/library.js',
format: 'umd',
moduleName: 'callieLib',
plugins: [ babel() ],
})
.pipe(source('lib.js'))
.pipe(header(banner, { pkg } ))
.pipe(gulp.dest(distPath));
});
gulp.task('css', function () {
var processors = [
postcssImport(),
potscssCssNext()
];
return gulp.src('./src/styles/index.css')
.pipe(postcss(processors))
.pipe(gulp.dest(distPath));
});
gulp.task('watch', () => {
gulp.watch('./src/scripts/**/*.js', ['datepicker', 'library']);
gulp.watch('./src/styles/**/*.css', ['css']);
});
gulp.task('default', ['datepicker', 'library', 'css']);