123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- module.exports = (grunt) ->
- grunt.initConfig
- pkg: grunt.file.readJSON 'package.json'
- concat:
- js:
- options:
- separator: "\n"
- src: [
- 'bower_components/jQuery/dist/jquery.min.js'
- 'bower_components/js-md5/js/md5.min.js'
- 'bower_components/mousetrap/mousetrap.min.js'
- 'bower_components/mousetrap/plugins/global-bind/mousetrap-global-bind.min.js'
- '../assets/js/*.js'
- ]
- dest: '../assets/min/main.js'
- css:
- options:
- separator: "\n"
- src: [
- '../assets/css/*.css'
- ]
- dest: '../assets/min/main.css'
- uglify:
- assets:
- options:
- banner: '/*! <%= pkg.name %> <%= pkg.version %> | <%= grunt.template.today("yyyy-mm-dd") %> */\n'
- files:
- '../assets/min/main.js': '../assets/min/main.js'
- cssmin:
- assets:
- options:
- banner: '/*! <%= pkg.name %> <%= pkg.version %> | <%= grunt.template.today("yyyy-mm-dd") %> */'
- files:
- '../assets/min/main.css': '../assets/min/main.css'
- 'file-creator':
- manifest:
- "../assets/min/cache.manifest": (fs, fd, done) ->
- text = """
- CACHE MANIFEST
- # #{ (new Date()).valueOf().toString() }
- main.css
- main.js
- ../img/no_images.svg
- ../img/password.svg
- """
- fs.writeSync fd, text
- done()
- watch:
- js:
- files: [
- '../assets/js/*.js'
- ]
- tasks: ['js']
- options:
- spawn: false
- interrupt: true
- css:
- files: [
- '../assets/css/*.css'
- ]
- tasks: ['css']
- options:
- spawn: false
- interrupt: true
- require('load-grunt-tasks')(grunt)
- grunt.registerTask 'default', ->
- grunt.task.run [
- 'js'
- 'css'
- 'file-creator'
- ]
- grunt.registerTask 'js', [
- 'concat:js'
- 'uglify:assets'
- ]
- grunt.registerTask 'css', [
- 'concat:css'
- 'cssmin:assets'
- ]
|