-
Notifications
You must be signed in to change notification settings - Fork 116
/
Copy pathGruntfile.js
100 lines (90 loc) · 2.84 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
/* global process:false */
"use strict";
var _ = require("lodash");
module.exports = function(grunt) {
require("load-grunt-tasks")(grunt);
var config = {
pkg: grunt.file.readJSON("package.json"),
banner: "/*!\n" +
" * element-resize-detector <%= pkg.version %>\n" +
" * Copyright (c) 2016 Lucas Wiener\n" +
" * <%= pkg.homepage %>\n" +
" * Licensed under <%= pkg.license %>\n" +
" */\n",
jshint: {
src: {
src: ["src/**/*.js", "*.js"]
},
test: {
src: "test/**/*.js"
},
options: {
jshintrc: true
}
},
browserify: {
dev: {
src: ["src/element-resize-detector.js"],
dest: "build/element-resize-detector.js",
options: {
browserifyOptions: {
standalone: "elementResizeDetectorMaker",
debug: true
}
}
},
dist: {
src: ["src/element-resize-detector.js"],
dest: "dist/element-resize-detector.js",
options: {
browserifyOptions: {
standalone: "elementResizeDetectorMaker"
}
}
}
},
usebanner: {
dist: {
options: {
position: "top",
banner: "<%= banner %>"
},
files: {
src: "dist/**/*"
}
}
},
uglify: {
dist: {
files: {
"dist/element-resize-detector.min.js": "dist/element-resize-detector.js"
}
}
},
karma: {
local: {
configFile: "karma.conf.js",
options: {
browsers: [
"Chrome",
"Safari",
"Firefox",
//"IE8 - Win7",
//"IE10 - Win7",
//"IE11 - Win8.1"
],
singleRun: true
}
}
}
};
grunt.initConfig(config);
grunt.registerTask("build:dev", ["browserify:dev"]);
grunt.registerTask("build:dist", ["browserify:dist"]);
grunt.registerTask("build", ["build:dev"]);
grunt.registerTask("dist", ["build:dist", "uglify:dist", "usebanner:dist"]);
grunt.registerTask("test:style", ["jshint"]);
grunt.registerTask("test", ["test:style", "build:dev", "karma:local"]);
grunt.registerTask("ci", ["test:style"]);
grunt.registerTask("default", ["test"]);
};