-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
56 lines (51 loc) · 1.45 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
45
46
47
48
49
50
51
52
53
54
55
56
'use strict';
var path = require('path');
var gulp = require('gulp');
var webpack = require('webpack');
gulp.task('bundle', function(cb) {
webpack({
entry: {
ui: './build/ui',
background: './build/background'
},
output: {
path: path.join(__dirname, './dist'),
filename: '[name].bundle.js'
},
module: {
loaders: [
{ test: /\.json$/, loader: "json" },,
{ test: /\.jsx$/, loader: 'jsx-loader?harmony=true' },
{ test: /\.css$/, loader: 'style-loader!css-loader' }
]
},
plugins: [
// new webpack.IgnorePlugin(/^serialport$/, /.*/)
],
externals: {
repl: 'repl'
},
resolveLoader: {
// this is a workaround for loaders being applied
// to linked modules
root: path.join(__dirname, 'node_modules')
},
resolve: {
// this is a workaround for aliasing a top level dependency
// inside a symlinked subdependency
root: path.join(__dirname, 'node_modules'),
alias: {
// replacing `fs` with a browser-compatible version
net: 'chrome-net',
serialport: 'browser-serialport',
"graceful-fs": 'browser-serialport',
dgram: 'chrome-dgram'
}
}
}, cb);
});
gulp.task('copy', function() {
return gulp.src(['./*.png', './manifest.json', './*.html', './*.css', './node_modules/avrgirl-arduino/junk/**'])
.pipe(gulp.dest('./dist/'));
});
gulp.task('default', ['bundle', 'copy']);