summaryrefslogtreecommitdiff
path: root/app/templates/Gruntfile.js
blob: cb5ac910fe8e6e6148aba1e82578e5aed8966c5e (plain)
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
module.exports = function(grunt) {

    // 1. All configuration goes here 
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),

        concat: {
          dist : {
//            expand : true,
            src: [
              'js/vendor/**/*.js',
              'js/main.js',
            ],
            dest: 'js/build/all.js',
          }
        },
        watch: {
          scripts: {
            files: ['js/*.js'],
            tasks: ['concat'],
            options: {
              interrupt: true,
              livereload: true,
              /* FIXME
              //<script src="//localhost:35729/livereload.js"></script>  livereloadjs script...might not need custom js, might be served internally
              //
              if https:
              livereload: {
                port: 9000,
                key: grunt.file.read('path/to/ssl.key'),
                cert: grunt.file.read('path/to/ssl.crt')
                // you can pass in any other options you'd like to the https server, as listed here: http://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener
               }*/
            },
          },
        },
        cdnify: {
          options: {
            cdn: require('google-cdn-data')
          },
          dist: {
            html: ['app/*.html']
          }
        }
    });

    // 3. Where we tell Grunt we plan to use this plug-in.
    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-google-cdn');
    grunt.loadNpmTasks('grunt-traceur');
    // 4. Where we tell Grunt what to do when we type "grunt" into the terminal.
    grunt.registerTask('default', ['concat','watch']);

};