-
Notifications
You must be signed in to change notification settings - Fork 159
/
Copy pathgulpfile.js
36 lines (31 loc) · 1020 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
const { src, dest, parallel } = require('gulp');
const concat = require('gulp-concat');
const uglify = require('gulp-uglify');
const babel = require('gulp-babel');
function dev() {
return src(['./src/react-apexcharts.jsx'])
.pipe(babel({
presets: ['@babel/preset-env', '@babel/preset-react'],
}))
.pipe(concat('react-apexcharts.js'))
.pipe(dest('./dist/')).on('end', () => console.log('Generated: react-apexcharts.js'));
}
function prod() {
return src(['./src/react-apexcharts.jsx'])
.pipe(babel({
presets: ['@babel/preset-env', '@babel/preset-react'],
plugins: ['@babel/plugin-proposal-object-rest-spread']
}))
.pipe(concat('react-apexcharts.min.js'))
.pipe(uglify())
.pipe(dest('./dist/'));
}
function types() {
return src(['./types/react-apexcharts.d.ts'])
.pipe(dest('./dist/'));
}
const prodBuild = parallel(prod, types);
const devBuild = parallel(dev, types);
exports.build = prodBuild;
exports.devBuild = devBuild;
exports.default = prodBuild;