1 | module.exports = function (grunt) {
|
2 | var js_files = ['Gruntfile.js', 'chance.js', 'test/*.js'];
|
3 |
|
4 | grunt.initConfig({
|
5 | jshint: {
|
6 | options: {
|
7 | curly: true,
|
8 | eqeqeq: true,
|
9 | expr: true,
|
10 | immed: true,
|
11 | indent: 4,
|
12 | latedef: true,
|
13 | newcap: true,
|
14 | noarg: true,
|
15 | sub: true,
|
16 | trailing: true,
|
17 | boss: true,
|
18 | eqnull: true,
|
19 | browser: true,
|
20 | white: false
|
21 | },
|
22 | globals: {
|
23 | exports: true,
|
24 | module: false
|
25 | },
|
26 | all: js_files
|
27 | },
|
28 | mocha_phantomjs: {
|
29 | all: ["test/runner.html"]
|
30 | },
|
31 | uglify: {
|
32 | my_target: {
|
33 | files: {
|
34 | 'chance.min.js': ['chance.js']
|
35 | }
|
36 | }
|
37 | },
|
38 | watch: {
|
39 | options: { livereload: true },
|
40 | files: js_files,
|
41 | tasks: ['jshint', 'mocha_phantomjs', 'uglify']
|
42 | }
|
43 | });
|
44 |
|
45 | grunt.loadNpmTasks('grunt-bump');
|
46 | grunt.loadNpmTasks('grunt-contrib-jshint');
|
47 | grunt.loadNpmTasks('grunt-contrib-uglify');
|
48 | grunt.loadNpmTasks('grunt-contrib-watch');
|
49 | grunt.loadNpmTasks('grunt-mocha-phantomjs');
|
50 |
|
51 | grunt.registerTask('default', ['watch']);
|
52 | grunt.registerTask('test', ['mocha_phantomjs']);
|
53 | };
|