Guest User

Untitled

a guest
Feb 28th, 2015
298
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module.exports = (grunt)->
  2.     grunt.initConfig
  3.         pkg: grunt.file.readJSON('package.json')
  4.  
  5.         slim:
  6.             dist:
  7.                 files:
  8.                     'build/index.html': 'index.slim'
  9.                     'build/templates/index.html': 'templates/index.slim'
  10.                     'build/templates/form.html': 'templates/form.slim'
  11.                     'build/templates/new.html': 'templates/new.slim'
  12.                     'build/templates/edit.html': 'templates/edit.slim'
  13.         sass:
  14.             dist:
  15.                 options:
  16.                     cacheLocation: 'temp/sass-cache'
  17.                 files:
  18.                     'build/css/style.css': ['assets/css/style.scss']
  19.  
  20.         coffee:
  21.             compileWithMaps:
  22.                 options:
  23.                     sourceMap: true
  24.                 files:
  25.                     'temp/js/app.js': [
  26.                         'assets/js/app.coffee',
  27.                         'assets/js/controllers/DataController.coffee' ]
  28.  
  29.         uglify:
  30.             dist:
  31.                 options:
  32.                     sourceMap: true
  33.                     compress:
  34.                         drop_console: true
  35.                 files:
  36.                     'temp/js/app.min.js': [ 'temp/js/app.js' ]
  37.  
  38.         concat:
  39.             options:
  40.                 separator: '\n'
  41.             app:
  42.                 src: [  'node_modules/angular/angular.min.js',
  43.                         'node_modules/angular-ui-router/release/angular-ui-router.min.js',
  44.                         'temp/js/app.min.js' ]
  45.                 dest: 'build/js/app.min.js'
  46.  
  47.         watch:
  48.             options:
  49.                 livereload: true
  50.             gruntfile:
  51.                 files: 'Gruntfile.coffee'
  52.                 tasks: ['apply']
  53.             scss:
  54.                 files: [ 'assets/css/style.scss' ]
  55.                 tasks: ['apply']
  56.             slim:
  57.                 files: [ 'index.slim',
  58.                          'templates/form.slim']
  59.                 tasks: ['apply']
  60.             coffee:
  61.                 files: [ 'assets/js/app.coffee',
  62.                          'assets/js/controllers/DataController.coffee']
  63.                 tasks: ['apply']
  64.  
  65.     grunt.loadNpmTasks 'grunt-slim'
  66.     grunt.loadNpmTasks 'grunt-contrib-sass'
  67.     grunt.loadNpmTasks 'grunt-contrib-coffee'
  68.     grunt.loadNpmTasks 'grunt-contrib-uglify'
  69.     grunt.loadNpmTasks 'grunt-contrib-concat'
  70.     grunt.loadNpmTasks 'grunt-contrib-watch'
  71.     grunt.loadNpmTasks 'grunt-newer'
  72.  
  73.     grunt.registerTask 'default', ['slim', 'sass', 'coffee', 'uglify', 'concat']
  74.     grunt.registerTask 'apply', 'apply changes in code', ()->
  75.         grunt.task.run 'newer:slim'
  76.         grunt.task.run 'newer:sass'
  77.         grunt.task.run 'newer:coffee'
  78.         grunt.task.run 'newer:uglify'
  79.         grunt.task.run 'newer:concat'
Advertisement
Add Comment
Please, Sign In to add comment