-
Notifications
You must be signed in to change notification settings - Fork 3
/
gulpfile.js
46 lines (40 loc) · 1.3 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
var gulp = require('gulp');
var traceur = require('gulp-traceur');
var traceurOptions = require('./config').traceur;
var connect = require('gulp-connect');
var clean = require('gulp-clean');
var requirejs = require('requirejs');
var rename = require("gulp-rename");
var es = require('event-stream');
var shell = require('gulp-shell')
gulp.task('clean', function(){
gulp.src('./dist/**/*.*')
.pipe(clean());
});
gulp.task('transpile', ['clean'], shell.task('node_modules/traceur/traceur --script src/main.js --out dist/transpiled-with-source-maps.js --sourcemap'));
gulp.task('concatenate', ['transpile'], function() {
requirejs.optimize({
baseUrl : 'src',
mainConfigFile : 'src/runtime-config.js',
out : 'dist/build.js',
include: ['traceur', 'runtime-config'],
findNestedDependencies: true,
wrap: true,
name: '../bower_components/almond/almond',
preserveLicenseComments: false
});
});
gulp.task('build', ['clean', 'concatenate'], function() {
gulp.src('index-production.html')
.pipe(rename("index.html"))
.pipe(gulp.dest('dist'));
});
gulp.task('watch', function() {
gulp.watch(path.src, ['transpile']);
});
gulp.task('serve', connect.server({
root: [__dirname],
port: 8000,
open: true,
livereload: false
}));