-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathGruntfile.js
135 lines (121 loc) · 3.14 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
fs = require('fs');
_ = require('underscore');
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
less: {
all: {
options: {
paths: ['src/less']
},
files: {
'dist/marionette-widget-gridview.css': 'src/less/main.less'
}
}
},
clean: ['dist'],
cssmin: {
all: {
files: {
'dist/marionette-widget-gridview.min.css': 'dist/marionette-widget-gridview.css'
}
}
},
uglify: {
main: {
options: {
compress: true,
mangle: true
},
files: {
'dist/marionette.gridview.min.js': [
'dist/marionette.gridview.js'
]
}
}
},
preprocess: {
bundle: {
src: 'src/js/build/bundled.js',
dest: 'dist/marionette.gridview.js'
}
},
jshint: {
options: {
curly: true,
eqeqeq: true,
eqnull: true,
browser: true
},
all: ['src/js/**/*.js']
},
karma: {
all: {
hostname: '127.0.0.1',
client: { captureConsole: true },
options: {
logLevel: 'INFO',
browsers: ['Firefox'],
frameworks: ['jasmine'],
reporters: ['progress'],
singleRun: true,
background: false,
captureConsole: true,
files: [
"node_modules/jquery/dist/jquery.min.js",
"node_modules/jquery-ui/jquery-ui.js",
"node_modules/underscore/underscore-min.js",
"node_modules/backbone/backbone.js",
"node_modules/backbone.marionette/lib/backbone.marionette.min.js",
"node_modules/gridstack/dist/gridstack.css",
"node_modules/gridstack/dist/gridstack.js",
"src/js/core.js",
"src/js/widget.js",
"src/js/widget-view.js",
"src/js/widget-gridview.js",
"example/custom.css",
"test/unit/libs/jasmine-jquery.js",
"test/unit/spec/**/*.js"
]
}
}
},
protractor: {
all: {
options: {
configFile: 'test/e2e/config.js'
}
}
},
watch: {
css: {
files: ['src/less/**/*.*'],
tasks: ['less', 'cssmin'],
options: {
spawn: false,
debounceDelay: 200
}
},
js: {
files: ['src/js/**/*.js'],
tasks: ['preprocess', 'uglify'],
options: {
spawn: false,
debounceDelay: 200
}
}
}
});
grunt.loadNpmTasks('grunt-mincer');
grunt.loadNpmTasks('grunt-preprocess');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-protractor-runner');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['clean', 'less', 'preprocess', 'uglify', 'cssmin', 'watch']);
grunt.registerTask('test', ['karma']);
};