forked from melonHuang/nova
-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
51 lines (46 loc) · 1.55 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 gulp = require('gulp'),
gulpLoadPlugins = require('gulp-load-plugins'),
plugins = gulpLoadPlugins();
gulp.task('build-component', function() {
// place code for your default task here
gulp.src('components/**/*.html')
.pipe(plugins.watch('components/**/*.html'))
.pipe(plugins.nova())
.pipe(plugins.rename(function(path) {
console.log('building component', path);
path.extname = '.js';
}))
.pipe(plugins.babel())
.pipe(gulp.dest('components'));
});
gulp.task('build-nova', function() {
gulp.src('src_babel/**/*.js')
.pipe(plugins.watch('src_babel/**/*.js'))
.pipe(plugins.babel())
.pipe(plugins.rename(function(path) {
console.log('building nova', path);
}))
.pipe(gulp.dest('src'))
.pipe(plugins.rename(function(path) {
gulp.start('concat-nova');
gulp.src('src/nova_dev.js')
.pipe(gulp.dest('./build'));
}))
});
gulp.task('concat-nova', function() {
gulp.src([
'src/nova_bootstrap.js',
'src/lib/css_parse.js',
'src/lib/case_map.js',
'src/lib/utils.js',
'src/style.js',
'src/event_behavior.js',
'src/aspect_behavior.js',
'src/properties_behavior.js',
'src/template_behavior.js',
'src/base.js'
])
.pipe(plugins.concat('nova.js'))
.pipe(gulp.dest('./build'));
});
gulp.task('default', ['build-nova', 'build-component']);