Merge tag 'upstream/1.7.1'
[debian_jquery-textcomplete.git] / Gruntfile.js
blob485aa24b58dbcf8bb6210938fb7e16feb91cf29a
1 /*jshint node: true */
3 module.exports = function (grunt) {
5   'use strict';
7   grunt.loadNpmTasks('grunt-contrib-concat');
8   grunt.loadNpmTasks('grunt-contrib-connect');
9   grunt.loadNpmTasks('grunt-contrib-uglify');
10   grunt.loadNpmTasks('grunt-contrib-watch');
12   grunt.initConfig({
13     pkg: grunt.file.readJSON('package.json'),
15     concat: {
16       dist: {
17         src: [
18           'src/start.frag',
19           'src/main.js',
20           'src/completer.js',
21           'src/dropdown.js',
22           'src/strategy.js',
23           'src/adapter.js',
24           'src/textarea.js',
25           'src/ie_textarea.js',
26           'src/content_editable.js',
27           'src/ckeditor.js',
28           'src/vendor/textarea_caret.js',
29           'src/end.frag'
30         ],
31         dest: 'dist/jquery.textcomplete.js'
32       }
33     },
35     uglify: {
36       options: {
37         banner:
38           '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
39           '<%= grunt.template.today("yyyy-mm-dd") %> */',
40         sourceMap: 'dist/jquery.textcomplete.min.map'
41       },
42       all: {
43         files: {
44           'dist/jquery.textcomplete.min.js': [
45             'dist/jquery.textcomplete.js'
46           ]
47         }
48       }
49     },
51     connect: {
52       server: {
53         options: {
54           port: 8000,
55           base: '../'
56         }
57       }
58     },
60     watch: {
61       all: {
62         files: ['src/*.js'],
63         tasks: ['concat', 'uglify']
64       }
65     }
66   });
68   grunt.registerTask('default', ['connect', 'watch']);
69   grunt.registerTask('build', ['concat', 'uglify']);