forked from MarshallOfSound/react-electron-web-view
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.babel.js
More file actions
37 lines (31 loc) · 830 Bytes
/
gulpfile.babel.js
File metadata and controls
37 lines (31 loc) · 830 Bytes
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
/* eslint-disable import/no-extraneous-dependencies */
import gulp from 'gulp';
import babelify from 'babelify';
import browserify from 'browserify';
import gutil from 'gulp-util';
import rimraf from 'gulp-rimraf';
import source from 'vinyl-source-stream';
const config = {
entryFile: './src/main.js',
outputDir: './lib',
outputFile: './ElectronWebView.js',
};
gulp.task('build', () =>
browserify(config.entryFile, {
extensions: ['jsx'],
standalone: 'ElectronWebView',
}).transform(babelify)
.external('react')
.external('react-dom')
.bundle()
.on('error', gutil.log)
.pipe(source(config.outputFile))
.pipe(gulp.dest(config.outputDir))
);
gulp.task('clean', () =>
gulp.src('./lib/**/*')
.pipe(rimraf())
);
gulp.task('watch', () => {
gulp.watch('./src/**/*', ['build']);
});