Skip to content

Commit a84ad2c

Browse files
Merge pull request #74 from telerik/vladimirov/add-grunt-pack
Add grunt pack command
2 parents ea23501 + 1a49d51 commit a84ad2c

File tree

2 files changed

+37
-3
lines changed

2 files changed

+37
-3
lines changed

Gruntfile.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,25 @@ module.exports = function(grunt) {
1313
devlib: {
1414
src: ["lib/**/*.ts"],
1515
reference: "lib/.d.ts"
16+
},
17+
release_build: {
18+
src: ["lib/**/*.ts"],
19+
reference: "lib/.d.ts",
20+
options: {
21+
sourceMap: false,
22+
removeComments: true
23+
}
24+
}
25+
},
26+
27+
shell: {
28+
options: {
29+
stdout: true,
30+
stderr: true
31+
},
32+
33+
build_package: {
34+
command: "npm pack"
1635
}
1736
},
1837

@@ -23,6 +42,20 @@ module.exports = function(grunt) {
2342

2443
grunt.loadNpmTasks("grunt-contrib-clean");
2544
grunt.loadNpmTasks("grunt-ts");
45+
grunt.loadNpmTasks('grunt-shell');
46+
47+
grunt.registerTask("remove_prepublish_script", function() {
48+
var packageJson = grunt.file.readJSON("package.json");
49+
delete packageJson.scripts.prepublish;
50+
grunt.file.write("package.json", JSON.stringify(packageJson, null, " "));
51+
});
52+
53+
grunt.registerTask("pack", [
54+
"clean",
55+
"remove_prepublish_script",
56+
"ts:release_build",
57+
"shell:build_package"
58+
]);
2659

2760
grunt.registerTask("default", "ts:devlib");
2861
}

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@
3838
"yargs": "4.7.1"
3939
},
4040
"devDependencies": {
41-
"grunt-contrib-clean": "0.6.0",
42-
"grunt": "0.4.5",
43-
"grunt-ts": "4.2.0",
41+
"grunt": "1.0.1",
42+
"grunt-contrib-clean": "1.0.0",
43+
"grunt-shell": "1.3.0",
44+
"grunt-ts": "5.5.1",
4445
"typescript": "1.7.5"
4546
},
4647
"engines": {

0 commit comments

Comments
 (0)