This repository has been archived by the owner on Sep 6, 2018. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Gruntfile.js
93 lines (88 loc) · 2.56 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
/* eslint-env node */
'use strict';
module.exports = function (grunt) {
grunt.util.linefeed = '\n';
require('load-grunt-tasks')(grunt);
require('time-grunt')(grunt);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
banner: (
"/*!\n * mq4-hover-shim v<%= pkg.version %>\n" +
" * <%= pkg.homepage %>\n" +
" * Copyright (c) 2014-2015 Christopher Rebert\n" +
" * Licensed under the MIT License (https://github.com/twbs/mq4-hover-shim/blob/master/LICENSE).\n" +
" */\n"
),
babel: {
options: {
loose: ['es6.modules'],
modules: "common" // output a CommonJS module
},
dist: {
files: {
'dist/cjs/<%= pkg.name %>.js': 'src/browser/<%= pkg.name %>.js'
}
}
},
browserify: {
options: {
banner: '<%= banner %>',
browserifyOptions: {
standalone: 'mq4HoverShim',
bundleExternal: false
}
},
dist: {
src: 'dist/cjs/<%= pkg.name %>.js',
dest: 'dist/browser/<%= pkg.name %>.js'
}
},
jshint: {
options: {
jshintrc: '.jshintrc'
},
gruntfile: {
src: 'Gruntfile.js'
},
lib: {
src: ['src/**/*.js']
},
test: {
src: ['test/**/*.js', '!test/lib/**/*.js']
}
},
jscs: {
gruntfile: {
src: '<%= jshint.gruntfile.src %>'
},
lib: {
src: ['src/**/*.js']
},
test: {
src: '<%= jshint.test.src %>'
}
},
eslint: {
options: {
config: '.eslintrc'
},
gruntfile: {
src: '<%= jshint.gruntfile.src %>'
},
lib: {
src: ['src/**/*.js', '!src/browser/**/*.js']
},
test: {
src: '<%= jshint.test.src %>'
}
},
nodeunit: {
files: ['test/**/*_test.js']
}
});
// Tasks
grunt.registerTask('lint', ['jshint', 'eslint', 'jscs']);
grunt.registerTask('dist', ['babel', 'browserify']);
grunt.registerTask('test', ['lint', 'dist', 'nodeunit']);
grunt.registerTask('default', ['test']);
};