-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
32 lines (25 loc) · 904 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
const gulp = require('gulp');
const del = require('del');
const inline = require('gulp-inline-source');
const browserify = require('browserify');
const babelify = require('babelify');
const source = require('vinyl-source-stream');
gulp.task('clean', async () => del.sync('dist'))
gulp.task('html', () => gulp.src('src/index.html')
.pipe(gulp.dest('dist'))
)
gulp.task('js-build', () => browserify({
entries: ['src/index.js', "node_modules/@walletconnect/client/dist/esm/index.js"],
extensions: ['.js'],
insertGlobals: true,
transform: [babelify.configure({ presets: ['@babel/preset-env'] })],
})
.bundle()
.pipe(source('index.js'))
.pipe(gulp.dest('./dist/scripts'))
);
gulp.task('inline-script', () => gulp.src('dist/index.html')
.pipe(inline({ compress: false }))
.pipe(gulp.dest('dist'))
)
gulp.task('default', gulp.series('clean', 'html', 'js-build', 'inline-script'))