forked from mozilla/thimble.mozilla.org
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.js
142 lines (137 loc) · 4.29 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
module.exports = function( grunt ) {
// Make grunt auto-load 3rd party tasks
// and show the elapsed time of each task when
// it runs
require('time-grunt')(grunt);
require('jit-grunt')(grunt, {
checkBranch: 'grunt-npm',
gitadd: 'grunt-git'
});
grunt.initConfig({
pkg: grunt.file.readJSON( "package.json" ),
requirejs: {
dist: {
options: {
waitSeconds: 120,
appDir: "public/",
baseUrl: "./",
dir: "dist",
keepBuildDir: true,
modules: [{
name: "editor/scripts/main"
}, {
name: "editor/scripts/project-list"
}, {
name: "homepage/scripts/main"
}],
findNestedDependencies: true,
optimizeCss: "none",
removeCombined: true,
paths: {
// Folders
"fc": "editor/scripts/editor/js/fc",
"project": "editor/scripts/project",
// Files
"bowser": "resources/scripts/vendor/bowser",
"bramble-editor": "editor/scripts/editor/js/bramble-editor",
"sso-override": "editor/scripts/sso-override",
"logger": "editor/scripts/logger",
"BrambleShim": "editor/scripts/bramble-shim",
"jquery": "../node_modules/jquery/dist/jquery.min",
"localized": "../node_modules/webmaker-i18n/localized",
"uuid": "../node_modules/node-uuid/uuid",
"cookies": "../node_modules/cookies-js/dist/cookies",
"PathCache": "editor/scripts/path-cache",
"constants": "editor/scripts/constants",
"EventEmitter": "../node_modules/wolfy87-eventemitter/EventEmitter.min",
"analytics": "editor/scripts/analytics",
"moment": "../node_modules/moment/min/moment-with-locales.min",
"gallery": "homepage/scripts/gallery",
"getinvolved": "homepage/scripts/getinvolved",
},
shim: {
"jquery": {
exports: "$"
}
},
optimize: 'uglify2',
preserveLicenseComments: false,
useStrict: true,
uglify2: {}
}
}
},
// Linting
lesslint: {
src: [
"./public/editor/stylesheets/*.less",
"./public/editor/stylesheets/*.css",
"./public/homepage/stylesheets/*.less",
"./public/homepage/stylesheets/*.css",
"./public/resources/remix/*.less",
"./public/resources/tutorial/*.less",
"./public/resources/tutorial/*.css"
],
options: {
csslint: {
"duplicate-properties": false,
"duplicate-background-images": false,
"display-property-grouping": false,
"fallback-colors": false,
"adjoining-classes": false,
"box-model": false,
"box-sizing": false,
"bulletproof-font-face": false,
"compatible-vendor-prefixes": false,
"floats": false,
"font-sizes": false,
"ids": false,
"important": false,
"outline-none": false,
"overqualified-elements": false,
"qualified-headings": false,
"regex-selectors": false,
"star-property-hack": false,
"underscore-property-hack": false,
"universal-selector": false,
"unique-headings": false,
"unqualified-attributes": false,
"vendor-prefix": false,
"zero-units": false
}
}
},
jshint: {
server: {
options: {
jshintrc: './.jshintrc'
},
files: {
src: [
"Gruntfile.js",
"app.js",
"server/**/*.js",
"constants.js"
]
}
},
frontend: {
options: {
jshintrc: './.jshintrc'
},
files: {
src: [
"public/editor/**/*.js",
"public/homepage/**/*.js",
"public/resources/remix/index.js",
"!public/homepage/scripts/google-analytics.js",
"!public/editor/scripts/google-analytics.js"
]
}
}
}
});
grunt.registerTask("test", [ "jshint:server", "jshint:frontend", "lesslint" ]);
grunt.registerTask("build", [ "test", "requirejs:dist" ]);
grunt.registerTask("default", [ "test" ]);
};