-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
88 lines (71 loc) · 3.5 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
85
86
87
module.exports = function(grunt) {
var config = {
pkg: grunt.file.readJSON('package.json'),
env: process.env,
};
grunt.util._.extend(config, loadConfig('./tasks/options/'));
grunt.initConfig(config);
require('load-grunt-tasks')(grunt);
grunt.loadTasks('tasks');
grunt.registerTask('default', "Build (in debug mode) & test your application.", ['test']);
grunt.registerTask('build', [
'clean:build',
'lock',
// Uncomment this line & `npm install --save-dev grunt-contrib-coffee` for CoffeeScript support.
// 'coffee',
'copy:prepare',
'transpile',
'jshint',
'copy:stage',
'copy:zeroClipboard',
'emberTemplates:compile',
// Uncomment this line & `npm install --save-dev grunt-sass` for SASS support.
'compass',
//'sass:compile',
// Uncomment this line & `npm install --save-dev grunt-contrib-less` for LESS support.
// 'less:compile'
// Uncomment this line & `npm install --save-dev grunt-contrib-stylus` for stylus/nib support.
// 'stylus:compile'
'concat_sourcemap',
'unlock' ]);
grunt.registerTask('build:debug', "Build a development-friendly version of your app.", [
'build',
'copy:vendor' ]);
grunt.registerTask('build:dist', "Build a minified & production-ready version of your app.", [
'clean:release',
'build',
'dom_munger:distDependencies',
'useminPrepare',
'concat',
'uglify',
'cssmin',
'copy:dist',
'rev',
'usemin' ]);
grunt.registerTask('deploy', "Generate assets with build:dist and deploy to S3.", [
'build:dist',
's3' ]);
grunt.registerTask('test', "Run your apps's tests once. Uses Google Chrome by default. Logs coverage output to tmp/public/coverage.", [
'build:debug', 'karma:test' ]);
grunt.registerTask('test:ci', "Run your app's tests in PhantomJS. For use in continuous integration (i.e. Travis CI).", [
'build:debug', 'karma:ci' ]);
grunt.registerTask('test:browsers', "Run your app's tests in multiple browsers (see tasks/options/karma.js for configuration).", [
'build:debug', 'karma:browsers' ]);
grunt.registerTask('test:server', "Start a Karma test server. Automatically reruns your tests when files change and logs the results to the terminal.", [
'build:debug', 'karma:server', 'connect:server', 'watch:test']);
grunt.registerTask('server', "Run your server in development mode, auto-rebuilding when files change.",
['build:debug', 'connect:server', 'watch:main']);
grunt.registerTask('server:dist', "Build and preview production (minified) assets.",
['build:dist', 'connect:dist:keepalive']);
};
// TODO: extract this out
function loadConfig(path) {
var glob = require('glob');
var object = {};
var key;
glob.sync('*', {cwd: path}).forEach(function(option) {
key = option.replace(/\.js$/,'');
object[key] = require(path + option);
});
return object;
}