|
1 | 1 | module.exports = function(grunt) { |
2 | | - grunt.loadNpmTasks('grunt-browserify'); |
3 | 2 |
|
4 | | - require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks); |
| 3 | + grunt.loadNpmTasks('grunt-browserify'); |
5 | 4 |
|
6 | | - grunt.initConfig({ |
7 | | - pkg: grunt.file.readJSON('package.json'), |
| 5 | + require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks); |
8 | 6 |
|
9 | | - watch: { |
10 | | - options: { |
11 | | - livereload: true |
12 | | - }, |
13 | | - source: { |
14 | | - files: [ |
15 | | - 'src/*.js', |
16 | | - 'src/*/*.js', |
17 | | - 'Gruntfile.js' |
18 | | - ], |
19 | | - tasks: ['build:js'] |
20 | | - } |
21 | | - }, |
| 7 | + grunt.initConfig({ |
| 8 | + pkg: grunt.file.readJSON('package.json'), |
22 | 9 |
|
23 | | - browserify: { |
24 | | - dist: { |
25 | | - src: [ |
26 | | - 'src/PublicLab.Editor.js' |
27 | | - ], |
28 | | - dest: 'dist/PublicLab.Editor.js' |
29 | | - }, |
30 | | - debug: { |
31 | | - options: { |
32 | | - browserifyOptions: { |
33 | | - debug: true |
34 | | - } |
| 10 | + watch: { |
| 11 | + options : { |
| 12 | + livereload: true |
| 13 | + }, |
| 14 | + source: { |
| 15 | + files: [ |
| 16 | + 'src/*.js', |
| 17 | + 'src/*/*.js', |
| 18 | + 'Gruntfile.js' |
| 19 | + ], |
| 20 | + tasks: [ 'build:js' ] |
| 21 | + } |
| 22 | + }, |
| 23 | + |
| 24 | + browserify: { |
| 25 | + dist: { |
| 26 | + src: [ |
| 27 | + 'src/PublicLab.Editor.js' |
| 28 | + ], |
| 29 | + dest: 'dist/PublicLab.Editor.js' |
| 30 | + }, |
| 31 | + debug: { |
| 32 | + options : { |
| 33 | + browserifyOptions: { |
| 34 | + debug: true |
| 35 | + } |
| 36 | + }, |
| 37 | + src: [ |
| 38 | + 'src/PublicLab.Editor.js' |
| 39 | + ], |
| 40 | + dest: 'dist/PublicLab.Editor.js' |
| 41 | + } |
35 | 42 | }, |
36 | | - src: [ |
37 | | - 'src/PublicLab.Editor.js' |
38 | | - ], |
39 | | - dest: 'dist/PublicLab.Editor.js' |
40 | | - } |
41 | | - }, |
42 | 43 |
|
43 | | - jasmine: { |
44 | | - publiclabeditor: { |
45 | | - src: 'dist/*.js', |
46 | | - options: { |
47 | | - specs: 'spec/javascripts/*spec.js', |
48 | | - vendor: [ |
49 | | - 'node_modules/jquery/dist/jquery.min.js', |
50 | | - 'node_modules/bootstrap/dist/js/bootstrap.min.js', |
51 | | - 'node_modules/blueimp-file-upload/js/vendor/jquery.ui.widget.js', |
52 | | - 'node_modules/blueimp-file-upload/js/jquery.iframe-transport.js', |
53 | | - 'node_modules/blueimp-file-upload/js/jquery.fileupload.js', |
54 | | - 'node_modules/typeahead.js/dist/typeahead.jquery.js', |
55 | | - 'node_modules/typeahead.js/dist/bloodhound.js', |
56 | | - 'node_modules/bootstrap-tokenfield/dist/bootstrap-tokenfield.js', |
57 | | - 'node_modules/jasmine-jquery/lib/jasmine-jquery.js', |
58 | | - 'node_modules/jasmine-ajax/lib/mock-ajax.js', |
59 | | - 'https://maps.googleapis.com/maps/api/js?libraries=places&language=en&key=AIzaSyDWgc7p4WWFsO3y0MTe50vF4l4NUPcPuwE', |
60 | | - 'node_modules/leaflet-blurred-location/dist/Leaflet.BlurredLocation.js', |
61 | | - 'node_modules/leaflet/dist/leaflet.js' |
62 | | - ] |
| 44 | + jasmine: { |
| 45 | + publiclabeditor: { |
| 46 | + src: 'dist/*.js', |
| 47 | + options: { |
| 48 | + specs: 'spec/javascripts/*spec.js', |
| 49 | + vendor: [ |
| 50 | + 'node_modules/jquery/dist/jquery.min.js', |
| 51 | + 'node_modules/popper.js/dist/umd/popper.min.js', |
| 52 | + 'node_modules/bootstrap/dist/js/bootstrap.js', |
| 53 | + 'node_modules/blueimp-file-upload/js/vendor/jquery.ui.widget.js', |
| 54 | + 'node_modules/blueimp-file-upload/js/jquery.iframe-transport.js', |
| 55 | + 'node_modules/blueimp-file-upload/js/jquery.fileupload.js', |
| 56 | + 'node_modules/typeahead.js/dist/typeahead.jquery.js', |
| 57 | + 'node_modules/typeahead.js/dist/bloodhound.js', |
| 58 | + 'node_modules/bootstrap-tokenfield/dist/bootstrap-tokenfield.js', |
| 59 | + 'node_modules/jasmine-jquery/lib/jasmine-jquery.js', |
| 60 | + 'node_modules/jasmine-ajax/lib/mock-ajax.js', |
| 61 | + 'https://maps.googleapis.com/maps/api/js?libraries=places&language=en&key=AIzaSyDWgc7p4WWFsO3y0MTe50vF4l4NUPcPuwE', |
| 62 | + 'node_modules/leaflet-blurred-location/dist/Leaflet.BlurredLocation.js', |
| 63 | + 'node_modules/leaflet/dist/leaflet.js' |
| 64 | + ] |
| 65 | + } |
| 66 | + } |
63 | 67 | } |
64 | | - } |
65 | | - } |
66 | 68 |
|
67 | | - }); |
| 69 | + }); |
| 70 | + |
| 71 | + /* Default (development): Watch files and build on change. */ |
| 72 | + grunt.registerTask('default', ['watch' , 'jasmine']); |
68 | 73 |
|
69 | | - /* Default (development): Watch files and build on change. */ |
70 | | - grunt.registerTask('default', ['watch', 'jasmine']); |
| 74 | + grunt.registerTask('build', [ |
| 75 | + 'browserify:dist' |
| 76 | + ]); |
71 | 77 |
|
72 | | - grunt.registerTask('build', [ |
73 | | - 'browserify:dist' |
74 | | - ]); |
| 78 | + grunt.registerTask('debug', [ |
| 79 | + 'browserify:debug' |
| 80 | + ]); |
75 | 81 |
|
76 | | - grunt.registerTask('debug', [ |
77 | | - 'browserify:debug' |
78 | | - ]); |
| 82 | + grunt.loadNpmTasks('grunt-contrib-jasmine'); |
79 | 83 |
|
80 | | - grunt.loadNpmTasks('grunt-contrib-jasmine'); |
81 | 84 | }; |
0 commit comments