-
Notifications
You must be signed in to change notification settings - Fork 259
/
Copy pathGruntfile.js
87 lines (82 loc) · 2.04 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
var path = require("path");
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('bower.json'),
"steal-export": {
"standalone-amd": {
system: {
config: __dirname + "/package.json!npm",
main: "syn/syn"
},
"outputs": {
"+global-js": {
dest: __dirname+"/build/syn.js"
},
"+amd": {
dest: __dirname+"/dist/amd"
},
"+cjs": {}
}
},
"tests": {
system: {
config: __dirname + "/package.json!npm",
main: "test/tests"
},
options: {
debug: true
},
"outputs": {
"+global-js": {
modules: ["test/tests"],
// Ignore everything without _test in the filename
ignore: /^((?!_test).)*$/,
dest: __dirname + "/build/tests/standalone_test.js",
exports: {
"jquery": "jQuery",
"steal-qunit": "QUnit",
"syn": "syn"
}
}
}
}
},
concat: {
options: {
banner: '/**\n * <%= pkg.title || pkg.name %> - <%= pkg.version %>\n * <%= pkg.homepage %>\n * @copyright <%= new Date().getFullYear() %> <%= pkg.author.name %>\n * <%= new Date().toUTCString() %>\n * @license <%= pkg.licenses[0].type %>\n */\n\n'
},
'dist/syn.js': ['build/syn.js']
},
jshint: {
options: {
jshintrc: true
},
lib: [
'src/**/*.js', 'test/**/*.js'
]
},
jsbeautifier: {
files: '<%= jshint.lib %>',
options: {
config: '.jsbeautifyrc'
}
},
testee: {
phantom: ['test/index.html',
'test/standalone.html',
'test/amd.html',
'test/built.html']
}
});
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-jsbeautifier');
grunt.loadNpmTasks('testee');
grunt.loadNpmTasks('steal-tools');
grunt.registerTask('quality', ['jsbeautifier', 'jshint']);
grunt.registerTask('build', ['steal-export:standalone-amd', 'concat']);
// Test tasks
grunt.registerTask('test', ['testee']);
grunt.registerTask('test:build', ['build', 'steal-export:tests', 'testee']);
};