-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathgrunt.js
More file actions
131 lines (118 loc) · 4.19 KB
/
grunt.js
File metadata and controls
131 lines (118 loc) · 4.19 KB
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
/*global module:false*/
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-rigger');
grunt.loadNpmTasks('grunt-contrib');
grunt.loadNpmTasks('grunt-jasmine-runner');
// Project configuration.
grunt.initConfig({
pkg: '<json:package.json>',
meta: {
version: '<%= pkg.version %>',
banner: '// BrixJS, v<%= meta.version %>\n' +
'// Copyright (c) <%= grunt.template.today("yyyy") %> Denis Davydkov.\n' +
'// Distributed under MIT license'
},
lint: {
files: ['src/brix.*.js']
},
rig: {
core_build: {
src: ['<banner:meta.banner>', 'src/build/brix.core.js'],
dest: 'lib/brix.core.js'
},
amd_build: {
src: ['<banner:meta.banner>', 'src/build/brix.amd.js'],
dest: 'lib/brix.amd.js'
}
},
copy: {
target: {
files: {
'boilerplate/libs/brix.js': ['lib/brix.amd.js']
}
}
},
jasmine: {
src: [
'boilerplate/libs/jquery-1.9.0.min.js',
'spec/javascripts/support/json2.js',
'boilerplate/libs/amdjs/underscore-1.4.3.js',
'boilerplate/libs/amdjs/backbone-0.9.10.js',
'spec/javascripts/support/marionette.core-1.0.0-rc4.js',
'spec/javascripts/support/brix.support.js',
'src/brix.helpers.js',
'src/brix.place.js',
'src/brix.placetokenizer.js',
'src/brix.placecontroller.js',
'src/brix.module.js',
'src/brix.activity.js',
'src/brix.activitymanager.js',
'src/brix.compositemanager.js'
],
helpers: 'spec/javascripts/helpers/*.js',
specs: 'spec/javascripts/**/*.spec.js'
},
'jasmine-server': {
browser: false
},
jshint: {
options: {
curly: true,
eqeqeq: true,
immed: false,
latedef: true,
newcap: true,
noarg: true,
sub: true,
undef: true,
boss: true,
eqnull: true,
browser: true
},
globals: {
Backbone: true,
Underscore: true,
Marionette: true,
Brix: true,
extend: true,
PLACE_PATH_SEPARATOR: true,
PLACE_CHANGE_EVENT: true
}
},
// Require JS Optimizer
requirejs: {
boilerplate: {
options: {
baseUrl: "boilerplate/js",
mainConfigFile: "boilerplate/js/config.js",
out: "boilerplate/compiled-application.js",
optimize: "uglify2",
name: "almond",
include: ["application"],
excludeShallow: ["text", "json", "jquery"],
pragmasOnSave: {
//removes Handlebars.Parser code (used to compile template strings) set
//it to `false` if you need to parse template strings even after build
excludeHbsParser: true,
// kills the entire plugin set once it's built.
excludeHbs: true,
// removes i18n precompiler, handlebars and json2
excludeAfterBuild: true,
// Exclude debug information
excludeDebug: true
},
enforceDefine: true,
inlineText: true,
wrap: false,
useStrict: true,
preserveLicenseComments: false,
skipModuleInsertion: false,
cjsTranslate: true
}
}
},
uglify: {}
});
// Default task.
grunt.registerTask('default', 'lint rig copy requirejs');
};