Skip to content

Commit

Permalink
allow publishing to npm
Browse files Browse the repository at this point in the history
  • Loading branch information
rnicholus committed Jan 6, 2015
1 parent bf3297d commit 3706fb0
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
node_modules
.DS_Store
support
.idea
dist
22 changes: 22 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,24 @@ module.exports = function(grunt) {
files: packagejson.buildFiles,
tasks: ['concat', 'jshint', 'uglify']
}
},
copy: {
npmPreRelease: {
files: [
{ flatten: true, expand: true, src: 'build/*', dest: 'dist/' },
{ src: 'package.json', dest: 'dist/' },
{ src: 'LICENSE', dest: 'dist/' },
{ src: 'README.md', dest: 'dist/' }
]
}
},
shell: {
npmRelease: {
command: [
'cd dist',
'npm -v'
].join('&&')
}
}
});

Expand All @@ -66,7 +84,11 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-shell');


// Default task.
grunt.registerTask('default', ['concat', 'jshint', 'uglify', 'watch']);
grunt.registerTask('publishToNpm', ['concat', 'jshint', 'uglify', 'copy:npmPreRelease', 'shell:npmRelease']);
};
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
"grunt-contrib-uglify": ">= 0.2.0",
"grunt-contrib-concat": ">= 0.1.3",
"grunt-contrib-watch": "0.2.0rc7",
"grunt-contrib-jshint": ">= 0.3.0"
"grunt-contrib-jshint": ">= 0.3.0",
"grunt-contrib-copy": ">= 0.7.0",
"grunt-shell": "^0.7.0"
},
"buildFiles": [
"src/config.js",
Expand Down

0 comments on commit 3706fb0

Please sign in to comment.