Skip to content

Commit

Permalink
Rename dist files to list-<version>.js and add version to start of mi…
Browse files Browse the repository at this point in the history
…nified file
  • Loading branch information
javve committed Oct 23, 2016
1 parent 9473d0d commit 79daff8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
17 changes: 14 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = function(grunt) {
},
shell: {
build: {
command: 'node_modules/browserify/bin/cmd.js index.js > dist/list.js',
command: 'node_modules/browserify/bin/cmd.js index.js > dist/list-<%= pkg.version %>.js',
options: {
stderr: true
}
Expand Down Expand Up @@ -49,10 +49,20 @@ module.exports = function(grunt) {
uglify: {
target: {
files: {
'dist/list.min.js': ['dist/list.js']
'dist/list-<%= pkg.version %>.min.js': ['dist/list-<%= pkg.version %>.js']
}
}
},
file_append: {
default_options: {
files: [
{
prepend: "// List.js v<%= pkg.version %> \n",
input: 'dist/list-<%= pkg.version %>.min.js'
}
]
}
},
mocha: {
test: {
src: [ 'test/index.html' ],
Expand All @@ -73,10 +83,11 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-mocha');
grunt.loadNpmTasks('grunt-file-append');

grunt.registerTask('mkdir', function() { grunt.file.mkdir("dist"); });
grunt.registerTask('default', ['jshint:code', 'jshint:tests', 'mkdir', 'shell:build']);
grunt.registerTask('dist', ['default', 'mkdir', 'shell:build', 'uglify']);
grunt.registerTask('dist', ['default', 'mkdir', 'shell:build', 'uglify', 'file_append']);
grunt.registerTask('clean', ['shell:remove']);
grunt.registerTask('test', ['dist', 'mocha']);

Expand Down
2 changes: 2 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
[See commit →](https://github.com/javve/list.js/commit/42d3db491801677c63238d5db3e0e9257087999a)
- **[Misc]** Use local Browserify
[See commit →](https://github.com/javve/list.js/commit/83f6502dcea428fa2de2513d19ac71f82905ecb8)
- **[Misc]** Rename dist files to list-<version>.js and add version to start of minified file
[See commit →](https://github.com/javve/list.js/commit/9cc48f6b2f429b591ee5eb82e2b2b48a00444638)

### 2016-02-27: v1.2.0
It's been two years since the last update of List.js. That is absolutely not ok
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"grunt-contrib-jshint": "^0.12.0",
"grunt-contrib-uglify": "^0.11.0",
"grunt-contrib-watch": "^0.6.1",
"grunt-file-append": "0.0.6",
"grunt-mocha": "1.0.1",
"grunt-shell": "^1.1.2",
"jquery": "^1.12.0"
Expand Down

0 comments on commit 79daff8

Please sign in to comment.