Files
jquery-notify/Gruntfile.coffee
T

54 lines
1.4 KiB
CoffeeScript
Raw Normal View History

2013-04-04 13:13:08 +11:00
fs = require("fs")
#global module:false
module.exports = (grunt) ->
2013-05-28 14:53:03 +10:00
2013-04-04 13:13:08 +11:00
# Project configuration.
grunt.initConfig
2013-05-28 14:53:03 +10:00
pkg: grunt.file.readJSON('package.json')
2013-04-04 13:13:08 +11:00
banner:
"/** <%= pkg.title || pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today(\"yyyy/mm/dd\") %>\n"+
" * <%= pkg.homepage %>\n" +
" * Copyright (c) <%= grunt.template.today(\"yyyy\") %> <%= pkg.author.name %> - MIT\n"+
2013-06-05 13:17:20 +10:00
" */\n"
2013-04-04 13:13:08 +11:00
coffee:
options:
bare: true
compile:
2013-06-05 13:17:20 +10:00
expand: true,
flatten: false,
cwd: 'src',
src: ['**/*.coffee'],
dest: 'dist/',
ext: '.js'
2013-04-04 13:13:08 +11:00
wrap:
dist:
2013-06-05 13:17:20 +10:00
src: 'dist/<%= pkg.name %>.js'
2013-04-04 13:13:08 +11:00
dest: '.'
2013-06-05 13:17:20 +10:00
wrapper: [
"<%= banner %>(function(window,document,undefined) {\n"
"\n}(window,document));"
]
2013-04-04 13:13:08 +11:00
uglify:
options:
stripBanners: true
banner: '<%= banner %>'
dist:
src: "dist/<%= pkg.name %>.js"
dest: "dist/<%= pkg.name %>.min.js"
watch:
scripts:
2013-06-05 13:17:20 +10:00
files: 'src/**/*.coffee'
2013-04-04 13:13:08 +11:00
tasks: 'default'
grunt.loadNpmTasks "grunt-contrib-watch"
grunt.loadNpmTasks "grunt-contrib-uglify"
2013-05-28 14:53:03 +10:00
grunt.loadTasks "./node_modules/grunt-contrib-coffee/tasks"
2013-04-04 13:13:08 +11:00
grunt.loadNpmTasks "grunt-wrap"
# Default task.
grunt.registerTask "default", "coffee wrap uglify".split(' ')