-
Notifications
You must be signed in to change notification settings - Fork 2
/
Gruntfile.js
50 lines (46 loc) · 1.35 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
'use strict';
/* For jshint: */
/* globals module, require */
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
browserify: {
adapterGlobalObject: {
src: ['./src/js/index.js'],
dest: './dist/enumerate-devices-shim.js',
options: {
browserifyOptions: {
// Exposes shim methods in a global object to the browser.
// The tests require this.
// TODO: Replace adapter with <%= pkg.name %>' which uses the name
// from package.json once we have a better NPM name.
standalone: 'adapter'
}
}
},
// Use this if you do not want adapter to expose anything to the global
// scope.
adapterAndNoGlobalObject: {
src: ['./src/js/index.js'],
dest: './dist/enumerate-devices-shim-no-global.js'
},
},
githooks: {
all: {
'pre-commit': 'lint'
}
},
eslint: {
options: {
configFile: '.eslintrc'
},
target: ['src/**/*.js', 'test/*.js']
},
});
grunt.loadNpmTasks('grunt-githooks');
grunt.loadNpmTasks('grunt-eslint');
grunt.loadNpmTasks('grunt-browserify');
grunt.registerTask('default', ['eslint', 'browserify']);
grunt.registerTask('lint', ['eslint']);
grunt.registerTask('build', ['browserify']);
};