-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.js
44 lines (39 loc) · 1.56 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
const gulp = require('gulp')
const rollup = require('rollup')
const rollupConfig = require('./rollup.config')
const cp = require('cp-file')
const path = require('path')
gulp.task('rollup-wx', function () {
const inputConfig = rollupConfig.getInputConfig('wx')
const outputCoinfig = rollupConfig.getOutputConfig('wx')
return rollup.rollup(inputConfig)
.then(function (bundle) {
bundle.write(outputCoinfig)
})
.then(() => {
return cp(path.resolve(__dirname, './wx.js'), path.resolve(__dirname, './examples/mp-fragment/utils/', 'nats.js'))
})
})
gulp.task('rollup-baidu', function () {
const inputConfig = rollupConfig.getInputConfig('baidu')
const outputCoinfig = rollupConfig.getOutputConfig('baidu')
return rollup.rollup(inputConfig)
.then(function (bundle) {
bundle.write(outputCoinfig)
})
.then(() => {
return cp(path.resolve(__dirname, './baidu.js'), path.resolve(__dirname, './examples/baidu-program/utils/', 'nats.js'))
})
})
gulp.task('rollup-alipay', function () {
const inputConfig = rollupConfig.getInputConfig('alipay')
const outputCoinfig = rollupConfig.getOutputConfig('alipay')
return rollup.rollup(inputConfig)
.then(function (bundle) {
bundle.write(outputCoinfig)
})
.then(() => {
return cp(path.resolve(__dirname, './alipay.js'), path.resolve(__dirname, './examples/alipay-program/utils/', 'nats.js'))
})
})
gulp.task('default', ['rollup-wx', 'rollup-baidu', 'rollup-alipay'])