Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
Clean up package.json
Browse files Browse the repository at this point in the history
- Removed License hack due to gruntjs/grunt-contrib-uglify#22
  • Loading branch information
dfreedm committed Nov 14, 2013
1 parent e269582 commit 51679cc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 36 deletions.
28 changes: 5 additions & 23 deletions gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
*/
module.exports = function(grunt) {
var readManifest = require('../tools/loader/readManifest.js');
var temporary = require('temporary');
var tmp = new temporary.File();

var Polymer = readManifest('build.json', [tmp.path]);
var Polymer = readManifest('build.json');

grunt.initConfig({
karma: {
Expand Down Expand Up @@ -36,13 +33,13 @@ module.exports = function(grunt) {
},
uglify: {
options: {
nonull: true,
preserveComments: 'some'
nonull: true
},
Polymer: {
options: {
sourceMap: 'polymer.min.js.map',
sourceMapIn: 'polymer.concat.js.map'
sourceMapIn: 'polymer.concat.js.map',
banner: grunt.file.read('LICENSE') + '// @version: <%= pkg.version %>'
//mangle: false, beautify: true, compress: false
},
files: {
Expand Down Expand Up @@ -103,21 +100,6 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-audit');

// Workaround for banner + sourceMap + uglify: https://github.com/gruntjs/grunt-contrib-uglify/issues/22
grunt.registerTask('gen_license', function() {
var banner = [
'/* @license',
grunt.file.read('LICENSE'),
'@version ' + grunt.file.readJSON('package.json').version,
'*/'
].join(grunt.util.linefeed);
grunt.file.write(tmp.path, banner);
});

grunt.registerTask('clean_license', function() {
tmp.unlinkSync();
});

grunt.registerTask('stash', 'prepare for testing build', function() {
grunt.option('force', true);
grunt.task.run('move:polymer.js:polymer.js.bak');
Expand All @@ -132,7 +114,7 @@ module.exports = function(grunt) {
grunt.registerTask('test-build', ['minify', 'stash', 'test', 'restore']);

grunt.registerTask('default', ['minify', 'audit']);
grunt.registerTask('minify', ['gen_license', 'concat_sourcemap', 'uglify', 'sourcemap_copy:polymer.concat.js.map:polymer.min.js.map', 'clean_license']);
grunt.registerTask('minify', ['concat_sourcemap', 'uglify', 'sourcemap_copy:polymer.concat.js.map:polymer.min.js.map']);
grunt.registerTask('docs', ['yuidoc']);
grunt.registerTask('test', ['override-chrome-launcher', 'karma:polymer']);
grunt.registerTask('test-buildbot', ['override-chrome-launcher', 'karma:buildbot', 'minify', 'stash', 'karma:buildbot', 'restore']);
Expand Down
25 changes: 12 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@
"name": "Polymer",
"version": "0.0.20131107",
"devDependencies": {
"mocha": "*",
"chai": "*",
"mocha": "~1.14.0",
"chai": "~1.8.1",
"grunt": "~0.4.1",
"grunt-contrib-uglify": "*",
"grunt-contrib-yuidoc": "*",
"grunt-karma": "*",
"karma-mocha": "*",
"karma-ie-launcher": "*",
"karma-safari-launcher": "*",
"karma-script-launcher": "*",
"karma-crbot-reporter": "*",
"grunt-audit": "~0.0.1",
"grunt-concat-sourcemap": "~0.3.0",
"temporary": "~0.0.7"
"grunt-contrib-uglify": "~0.2.7",
"grunt-contrib-yuidoc": "~0.5.0",
"grunt-karma": "~0.6.2",
"karma-mocha": "~0.1.0",
"karma-ie-launcher": "~0.1.1",
"karma-safari-launcher": "~0.1.1",
"karma-script-launcher": "~0.1.0",
"karma-crbot-reporter": "0.0.4",
"grunt-audit": "0.0.2",
"grunt-concat-sourcemap": "~0.3.2"
}
}

0 comments on commit 51679cc

Please sign in to comment.