-
Notifications
You must be signed in to change notification settings - Fork 3
/
gulpfile.js
54 lines (45 loc) · 1.19 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
var fs = require('fs');
var gulp = require('gulp');
var webpack = require('webpack');
var uglify = require('gulp-uglify');
var spawn = require('child_process').spawn;
var pkg;
gulp.task('build', function(done) {
webpack({
entry: "./src/index.js",
output: {
filename: 'rgl.js',
path: __dirname,
library: "rgl",
libraryTarget: 'umd'
},
resolve : {
alias:{
regularjs: "../bower_components/regularjs/dist/regular.js",
text: '../bower_components/requirejs-text/text.js'
}
},
externals: ["regularjs"]
}, function(err, stats){
if(stats.hasErrors() || err){
throw stats.toJson().errors
}else{
console.log("done!")
}
done()
})
});
gulp.task("default",["build"])
gulp.task("dev", function(){
gulp.watch(['component.json', 'src/index.js'], ['build'])
// var puer = spawn('puer', ["--no-reload"], {})
// puer.stdout.on('data', function (data) {
// console.log(""+ data);
// });
// puer.stderr.on('data', function (data) {
// console.log('stderr: ' + data);
// });
// puer.on('close', function (code) {
// console.log('puer test compelete!');
// });
})