-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathGruntfile.js
84 lines (71 loc) · 2.07 KB
/
Gruntfile.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
var gruntModules = require( "grunt-modules" );
module.exports = function ( grunt )
{
"use strict";
var minify = grunt.option( 'minify' ) === undefined || grunt.option( 'minify' ) === true;
grunt.option( 'transform', minify ? 'uglifyify' : '' );
grunt.initConfig( {
pkg: grunt.file.readJSON( 'package.json' ),
watch: {
express: {
files: 'src/main/node/**/*.js',
tasks: ['express'],
options: {
nospawn: true
}
},
browserify: {
// match all .js files in www, unless it's in a dist folder.
files: ['src/main/www/**/*.js', '!**/dist/**/*.js'],
tasks: ['browserify']
},
autoprefixer: {
// match all .css files in www, unless it's in a dist folder.
files: ['src/main/www/**/*.css', '!**/dist/**/*.css'],
tasks: ['autoprefixer']
}
},
jshint: {
// define the files to lint
files: ['Gruntfile.js', 'src/main/www/**/*.js', 'src/test/www/**/*.js', '!**/dist/**/*.js', '!src/main/www/libs/**/*.js'],
// configure JSHint (documented at http://www.jshint.com/docs/)
options: {
// more options here if you want to override JSHint defaults
globals: {
jQuery: true,
console: true,
module: true,
require: true,
angular: true
}
}
},
express: {
server: {
options: {
script: 'src/main/node/server.js',
background: true
}
}
}
} );
/* Each page gets its own module (typically), define a new one by copying and pasting a line and the respective config file here */
gruntModules( grunt, {
vendor: require( "./grunt.vendor.js" ),
automation: require( "./grunt.automation.js" ),
index: require( "./grunt.index.js" )
} );
grunt.loadNpmTasks( 'grunt-browserify' );
grunt.loadNpmTasks( 'grunt-autoprefixer' );
grunt.loadNpmTasks( 'grunt-express-server' );
grunt.loadNpmTasks( 'grunt-contrib-watch' );
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
grunt.loadNpmTasks( 'grunt-karma' );
grunt.registerTask( 'default', [
'browserify',
'autoprefixer',
'express',
'watch'
] );
grunt.registerTask( 'ci', ['jshint', 'browserify', 'autoprefixer', 'karma'] );
};