forked from stefanpenner/es6-promise
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
53 lines (39 loc) · 1.85 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
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
var config = require('load-grunt-config')(grunt, {
configPath: 'tasks/options',
init: false
});
grunt.loadTasks('tasks');
this.registerTask('default', ['build']);
// Run client-side tests on the command line.
this.registerTask('test', 'Runs tests through the command line using PhantomJS', [
'build', 'tests', 'connect'
]);
// Run a server. This is ideal for running the QUnit tests in the browser.
this.registerTask('server', ['build', 'tests', 'connect', 'watch:server']);
// Build test files
this.registerTask('tests', 'Builds the test package', ['concat:deps', 'browserify:tests',
'transpile:testsAmd', 'transpile:testsCommonjs', 'buildTests:dist']);
// Build a new version of the library
this.registerTask('build', 'Builds a distributable version of <%= cfg.name %>',
['clean', 'transpile:amd', 'transpile:commonjs', 'concat:amd',
'concat:browser', 'browser:dist', 'jshint', 'uglify:browser']);
// Custom phantomjs test task
this.registerTask('test:phantom', "Runs tests through the command line using PhantomJS", [
'build', 'tests', 'mocha_phantomjs']);
// Custom Node test task
this.registerTask('test:node', ['build', 'tests', 'mochaTest']);
this.registerTask('test', ['build', 'tests', 'mocha_phantomjs', 'mochaTest']);
// Custom YUIDoc task
this.registerTask('docs', ['yuidoc']);
config.env = process.env;
config.pkg = grunt.file.readJSON('package.json');
// Load custom tasks from NPM
grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-mocha-phantomjs');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-contrib-yuidoc');
// Merge config into emberConfig, overwriting existing settings
grunt.initConfig(config);
};