-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
146 lines (129 loc) · 5.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
module.exports = function (grunt) {
//modules
var handlebars = require('handlebars');
var modulusWebsite = {
dist:'dist/modulusjs.org',
src: 'modulusjs.org/source'
};
with(modulusWebsite){
modulusWebsite.cssSrc = src + '/css';
modulusWebsite.cssDist = dist + '/css';
modulusWebsite.jsSrc = src + '/js';
modulusWebsite.jsDist = dist + '/js';
modulusWebsite.fontSrc = src + '/fonts';
modulusWebsite.fontDist = dist + '/fonts';
modulusWebsite.imgSrc = src + '/img';
modulusWebsite.imgDist = dist + '/img';
modulusWebsite.testDist = dist + '/test';
}
var uglifyConfig = {
};
grunt.initConfig({
modulus:{
site: modulusWebsite
},
jasmine: {
modulus:{
src: 'todo',
options: {
specs: 'test/spec/*Spec.js',
helpers: 'test/spec/*Helper.js'
}
}
},
copy:{
siteFonts:{
cwd:modulusWebsite.fontSrc + '/',
expand: true,
src: '**/*',
dest: modulusWebsite.fontDist
},
siteImages:{
cwd:modulusWebsite.imgSrc + '/',
expand: true,
src: '**/*',
dest: modulusWebsite.imgDist
},
siteJs:{
cwd:modulusWebsite.jsSrc + '/',
expand: true,
src: '**/*',
dest: modulusWebsite.jsDist
},
// //first copy all of test files
// testFiles:{
// cwd:'test/',
// expand:true,
// src:'**/*',
// dest: modulusWebsite.testDist
// }
},
// watch: {
// scripts: {
// files: ['src/**/*.js'],
// tasks: ['build']
// },
// specs: {
// files: ['test/spec/**/*.js'],
// tasks: ['test']
// }
// },
uglify: {
options: {
//http://lisperator.net/uglifyjs/compress
// compress:{
// sequences : false, // join consecutive statemets with the “comma operator”
// properties : false, // optimize property access: a["foo"] → a.foo
// dead_code : true, // discard unreachable code
// drop_debugger : true, // discard “debugger” statements
// unsafe : false, // some unsafe optimizations (see below)
// conditionals : false, // optimize if-s and conditional expressions
// comparisons : false, // optimize comparisons
// evaluate : false, // evaluate constant expressions
// booleans : false, // optimize boolean expressions
// loops : false, // optimize loops
// unused : true, // drop unused variables/functions
// hoist_funs : false, // hoist function declarations
// hoist_vars : false, // hoist variable declarations
// if_return : false, // optimize if-s followed by return/continue
// join_vars : false, // join var declarations
// cascade : false, // try to cascade `right` into `left` in sequences
// side_effects : true, // drop side-effect-free statements
// warnings : true, // warn about potentially dangerous optimizations/code
// global_defs : {} // global definitions
// },
report: 'gzip'
},
modulusTest: {
files: [
{
expand: true,
cwd: 'dist/test',
src: '**/*.js',
dest: 'dist/test'
}
]
}
}
});
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadTasks('grunt-tasks/test/buildtime-project');
grunt.loadTasks('grunt-tasks/test/buildtime-project2');
grunt.loadTasks('grunt-tasks/test/buildtime-project3');
grunt.loadTasks('grunt-tasks/modulusjs.org');
grunt.registerTask('build-site', ['copy:siteFonts', 'copy:siteImages', 'copy:siteJs']);
grunt.registerTask('build-test', [
'build-buildtime-project',
'build-buildtime-project2',
'build-buildtime-project3',
'uglify:modulusTest'
]);
// grunt.registerTask('test', ['jasmine']);
// grunt.registerTask('build', ['', 'jasmine:modulus']);
// grunt.registerTask('build-and-minify', ['build', 'uglify:modulus']);
//
// grunt.registerTask('default', ['compile-nn-templates', 'test', 'uglify']);
};