Skip to content

Commit

Permalink
Add minification.
Browse files Browse the repository at this point in the history
  • Loading branch information
avp committed Nov 20, 2013
1 parent 5b9640b commit 4b97965
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 8 deletions.
29 changes: 23 additions & 6 deletions Gruntfile.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,35 @@ module.exports = (grunt) ->
grunt.initConfig
pkg: grunt.file.readJSON 'package.json'

uglify:
prod:
options:
mangle:
except: ['Spectra']
files:
'spectra.min.js': ['spectra.js']

jasmine:
src: 'spectra.js'
options:
specs: 'test/**/*.js'
dev:
src: 'spectra.js'
options:
specs: 'test/**/*.js'
prod:
src: 'spectra.min.js'
options:
specs: 'test/**/*.js'

watch:
jasmine:
files: ['*.js', 'test/**/*.js']
tasks: ['jasmine']
tasks: ['jasmine:dev']
uglify:
files: ['spectra.js']
tasks: ['uglify']

grunt.loadNpmTasks 'grunt-contrib-jasmine'
grunt.loadNpmTasks 'grunt-contrib-uglify'
grunt.loadNpmTasks 'grunt-contrib-watch'

grunt.registerTask 'test', ['jasmine']
grunt.registerTask 'default', ['jasmine', 'watch']
grunt.registerTask 'test', ['jasmine:dev', 'uglify', 'jasmine:prod']
grunt.registerTask 'default', ['uglify', 'jasmine:dev', 'watch']
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"devDependencies": {
"grunt-contrib-jasmine": "~0.4.0",
"grunt-contrib-watch": "~0.5.1",
"grunt": "~0.4.1"
"grunt": "~0.4.1",
"grunt-contrib-uglify": "~0.2.7"
}
}
3 changes: 2 additions & 1 deletion spectra.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/**!
* Spectra.js
*
* Wrapping a value with Spectra() returns a Spectra object.
Expand Down Expand Up @@ -521,4 +521,5 @@

// Set the global variable Spectra to the wrapper that we have defined.
root.Spectra = Spectra;

}).call(this);
1 change: 1 addition & 0 deletions spectra.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4b97965

Please sign in to comment.