-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
41 lines (35 loc) · 820 Bytes
/
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
const gulp = require('gulp');
const rollup = require('rollup');
const babel = require('rollup-plugin-babel');
gulp.task('dev', () => {
gulp.watch('src/*', ['build']);
});
gulp.task('build:umd', async () => {
const bundle = await rollup.rollup({
input: './src/parabox.js',
plugins: [
babel({
exclude: 'node_modules/**',
}),
],
});
bundle.write({
file: 'dist/parabox.js',
format: 'umd',
name: 'parabox',
sourcemap: true,
});
});
gulp.task('build:es', async () => {
const bundle = await rollup.rollup({
input: './src/parabox.js',
});
bundle.write({
file: 'dist/parabox.es.js',
format: 'es',
sourcemap: true,
});
});
gulp.task('build', ['build:umd', 'build:es'], async () => {
gulp.src('src/parabox.css').pipe(gulp.dest('dist'));
});