Skip to content

Commit

Permalink
Support minification with uglify
Browse files Browse the repository at this point in the history
  • Loading branch information
kewisch committed Jun 4, 2015
1 parent 392bb11 commit ebe81d4
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -9,4 +9,6 @@ api
jsdoc-stage
coverage/
build/benchmark/ical_upstream.js
build/ical.min.js
build/ical.min.js.map
junk/
19 changes: 18 additions & 1 deletion Gruntfile.js
Expand Up @@ -132,6 +132,22 @@ module.exports = function(grunt) {
src: ['tools/ICALTester/**/*.js']
}
},
uglify: {
options: {
sourceMap: true,
preserveComments: false,
screwIE8: true,
compress: {},
mangle: {
except: ['ICAL']
}
},
dist: {
files: {
'build/ical.min.js': ['build/ical.js']
}
}
},
release: {
options: {
tagName: 'v<%=version%>',
Expand Down Expand Up @@ -177,6 +193,7 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-concurrent');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-coveralls');
grunt.loadNpmTasks('grunt-gjslint');
grunt.loadNpmTasks('grunt-gh-pages');
Expand All @@ -189,7 +206,7 @@ module.exports = function(grunt) {
grunt.loadTasks('tasks');

grunt.registerTask('default', ['package']);
grunt.registerTask('package', ['concat']);
grunt.registerTask('package', ['concat', 'uglify']);
grunt.registerTask('coverage', 'mocha_istanbul');
grunt.registerTask('linters', ['jshint', 'gjslint', 'check-browser-build']);
grunt.registerTask('test-server', ['test-agent-config', 'run-test-server']);
Expand Down
3 changes: 3 additions & 0 deletions README.md
Expand Up @@ -126,3 +126,6 @@ single-file build for use in the browser. This file needs to be checked in (in
a separate commit) and can be found in [build/ical.js](build/ical.js). Please
see [CONTRIBUTING.md](CONTRIBUTING.md) for more details.

Running the `package` target will also create a minified version in
`build/ical.min.js`. This file is not pushed to the repository at the moment,
but you can use it for front end projects.
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -30,6 +30,7 @@
"grunt-concurrent": "^1.0.0",
"grunt-contrib-concat": "^0.5.1",
"grunt-contrib-jshint": "^0.11.2",
"grunt-contrib-uglify": "^0.9.1",
"grunt-coveralls": "^1.0.0",
"grunt-gh-pages": "^0.10.0",
"grunt-gjslint": "^0.1.6",
Expand Down

0 comments on commit ebe81d4

Please sign in to comment.