forked from Betterment/test_track_js_client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
67 lines (60 loc) · 1.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
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
all: {
options: {
jshintrc: '.jshintrc'
},
src: ['src/**/*.js']
}
},
karma: {
options: {
configFile: 'test/karma.conf.js'
},
run: {
browsers: ['PhantomJS']
},
crossBrowser: {
browsers: ['PhantomJS', 'Chrome', 'Firefox']
}
},
preprocess: {
options: {
context: {
version: '<%= pkg.version %>'
}
},
build: {
src: 'src/testTrack.js',
dest: 'dist/testTrack.js'
}
},
uglify: {
build: {
files: {
'dist/testTrack.min.js': ['dist/testTrack.js'],
'dist/testTrack.bundle.min.js': [
'bower_components/base-64/base64.js',
'bower_components/blueimp-md5/js/md5.js',
'bower_components/node-uuid/uuid.js',
'bower_components/jquery.cookie/jquery.cookie.js',
'dist/testTrack.js'
]
}
}
},
'release-it': {
options: {
pkgFiles: ['package.json', 'bower.json'],
buildCommand: 'grunt',
npm: false
}
}
});
grunt.registerTask('test', 'Run jshint and tests.', ['jshint', 'karma:run']);
grunt.registerTask('default', ['test', 'build']);
grunt.registerTask('build', ['preprocess', 'uglify']);
};