Skip to content

Commit

Permalink
npm: Add grunt copy
Browse files Browse the repository at this point in the history
  • Loading branch information
palcarazm committed Jan 10, 2023
1 parent 9fa2d4d commit 6ab4c55
Show file tree
Hide file tree
Showing 3 changed files with 152 additions and 3 deletions.
15 changes: 15 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,25 @@ module.exports = function (grunt) {
},
},
},
copy: {
main: {
src: "README.template.md",
dest: "README.md",
options: {
process: function (content, _srcpath) {
let pkg = grunt.file.readJSON("package.json");
return content.replace(/#version#/g, pkg.version);
},
},
},
},
});
grunt.loadNpmTasks("grunt-contrib-clean");
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-contrib-cssmin");
grunt.loadNpmTasks("grunt-contrib-copy");
grunt.loadNpmTasks("grunt-banner");
grunt.registerTask("default", ["clean", "uglify", "cssmin", "usebanner"]);
grunt.registerTask("build", ["clean", "uglify", "cssmin", "usebanner"]);
grunt.registerTask("readme", ["copy"]);
};
133 changes: 133 additions & 0 deletions package-lock.json

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

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
"js/*"
],
"scripts": {
"build": "grunt",
"postversion": "grunt",
"prepublishOnly": "grunt"
"build": "grunt build",
"postversion": "grunt build && grunt readme && doctoc README.md --github",
"test": "cypress run --browser=chrome"
},
"keywords": [
"bootstrap",
Expand Down Expand Up @@ -50,6 +50,7 @@
"grunt": "^1.5.3",
"grunt-banner": "^0.6.0",
"grunt-contrib-clean": "^2.0.1",
"grunt-contrib-copy": "^1.0.0",
"grunt-contrib-cssmin": "^4.0.0",
"grunt-contrib-uglify": "^5.2.1"
},
Expand Down

0 comments on commit 6ab4c55

Please sign in to comment.