47 lines
1.2 KiB
CoffeeScript
47 lines
1.2 KiB
CoffeeScript
module.exports = (grunt) ->
|
|
@loadNpmTasks('grunt-browserify')
|
|
@loadNpmTasks('grunt-contrib-clean')
|
|
@loadNpmTasks('grunt-contrib-jshint')
|
|
@loadNpmTasks('grunt-contrib-uglify')
|
|
@loadNpmTasks('grunt-contrib-watch')
|
|
@loadNpmTasks('grunt-mocha-cli')
|
|
|
|
@initConfig
|
|
clean:
|
|
dist: ['dist']
|
|
|
|
jshint:
|
|
all: [ 'lib/*.js', 'test/*.js' ]
|
|
options:
|
|
jshintrc: '.jshintrc'
|
|
|
|
watch:
|
|
all:
|
|
options:
|
|
atBegin: true
|
|
files: ['lib/**.js', 'test/*{,/*}']
|
|
tasks: ['test']
|
|
|
|
mochacli:
|
|
options:
|
|
files: 'test/*.js'
|
|
spec:
|
|
options:
|
|
reporter: 'spec'
|
|
|
|
browserify:
|
|
dist:
|
|
files:
|
|
'dist/pofile.js': ['lib/po.js']
|
|
options:
|
|
alias: 'lib/po.js:pofile'
|
|
|
|
uglify:
|
|
dist:
|
|
files:
|
|
'dist/pofile.min.js': 'dist/pofile.js'
|
|
|
|
@registerTask 'default', ['test']
|
|
@registerTask 'build', ['clean', 'jshint', 'browserify', 'uglify']
|
|
@registerTask 'test', ['build', 'mochacli']
|