forked from coreytegeler/fourcorners
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
40 lines (28 loc) · 1000 Bytes
/
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
'use strict';
module.exports = function (grunt) {
var configPath = grunt.option("config"),
tskList, config;
if (!configPath) {
throw "Path to config file is not provided. Define after --config"
}
config = grunt.file.readJSON(configPath);
grunt.config.set('environment', config);
grunt.config.set('pkg', grunt.file.readJSON('package.json'));
require('./grunt-tasks/browserify')(grunt);
require('./grunt-tasks/copy')(grunt);
require('./grunt-tasks/uglify')(grunt);
require('./grunt-tasks/watch')(grunt);
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
tskList = ['browserify'];
if (config.uglifyJs) {
tskList.push('uglify');
}
tskList.push.apply(tskList, ['copy']);
if (config.watch) {
tskList.push('watch');
}
grunt.registerTask('default', tskList);
};