-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathGruntfile.js
executable file
·96 lines (81 loc) · 2.31 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
88
89
90
91
92
93
94
95
96
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',
'share',
'watch:server'
]);
// Build test files
this.registerTask('tests', 'Builds the test package', [
'concat:deps',
'browserify:tests',
'transpile:testsAmd',
'transpile:testsCommonjs',
'concat:amdNodeTests', // yet another hack to get es6 transpiled tests
'concat:amdTests' // yet another hack to get es6 transpiled tests
]);
// 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',
'concat:amdNoVersion',
'browser:dist',
'browser:distNoVersion',
'uglify:browser'
]);
// Custom phantomjs test task
/* this.registerTask('test:phantom', "Runs tests through the command line using PhantomJS", [
'build',
'tests'
]);*/
// Custom Node test task
/* this.registerTask('test:node', [
'build',
'tests',
'mochaTest'
]);*/
this.registerTask('test', [
'build',
'tests',
'share',
'mocha_phantomjs'
]);
this.registerTask('build-release', [
'clean:build',
'transpile:amd',
'transpile:commonjs',
'concat:browser',
'browser:distNoVersion',
'concat:amdNoVersion',
'uglify:browserNoVersion'
]);
// 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');
grunt.loadNpmTasks('grunt-release-it');
// Merge config into emberConfig, overwriting existing settings
grunt.initConfig(config);
};