-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
57 lines (50 loc) · 1.73 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
57
var gulp = require('gulp'),
argv = require('yargs').argv,
plugins = require('gulp-load-plugins')(),
path = require('path');
gulp.task('watch', function () {
gulp.watch('./src/**/*.less', ['less']);
});
gulp.task("rjs", function() {
var boot = argv.bootstrapped,
uglify = !argv.nouglify,
suffix = uglify ? '.min' : '';
plugins.requirejs({
baseUrl: 'src/scripts',
name: '../../bower_components/almond/almond',
include: ['ngGitNav'],
deps: boot ? ["config"] : [],
out: boot ? './ngGitNav.bootstrapped'+suffix+'.js' : './ngGitNav'+suffix+'.js',
stubModules : ['../../bower_components/require-css/css', '../../bower_components/require-css/./normalize'],
wrap: {
startFile: 'config/start.frag',
endFile: 'config/end.frag'
}
})
.pipe(plugins.if(uglify, plugins.uglify()))
.pipe(gulp.dest("dist"));
});
gulp.task('less', function () {
gulp.src('./src/styles/*.less')
.pipe(plugins.less({
paths: [ path.join(__dirname, 'less', 'includes') ]
}))
.pipe(gulp.dest('./src/styles'));
});
gulp.task('lint', function () {
gulp.src(['src/**/*.js'])
.pipe(plugins.eslint({
globals: {
'require':true,
'define': true,
'document': true,
'angular': true
}
}))
.pipe(plugins.eslint.format());
});
gulp.task('dev', ["lint", "less", "watch"]);
gulp.task('build', ["lint", "less", "rjs"]);
// TODO: Follow up require-css issue to load octicons.css: https://github.com/guybedford/require-css/issues/163
// TODO: Create gh-pages for standalone and not standalone versions
// TODO: Improve README