Skip to content

Commit 33d88b4

Browse files
committed
chore(build): Added watch and uglify grunt tasks to the build process
1 parent d4477e9 commit 33d88b4

File tree

5 files changed

+49
-1
lines changed

5 files changed

+49
-1
lines changed

.eslintignore

Whitespace-only changes.

GruntFile.js

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module.exports = function (grunt) {
77
// Import package manifest
88
pkg: grunt.file.readJSON("package.json"),
99

10-
projectName:"lunar",
10+
projectName:"<%= pkg.name %>",
1111

1212
// Banner definitions
1313
meta: {
@@ -41,10 +41,40 @@ module.exports = function (grunt) {
4141
src : 'src/<%= projectName %>.js',
4242
dest: 'dist/<%= projectName %>.js'
4343
}
44+
},
45+
46+
watch:{
47+
js:{
48+
files:["src/**/*.js"],
49+
tasks:["eslint","rollup","uglify"]
50+
}
51+
},
52+
53+
uglify:{
54+
options: {
55+
banner: "<%= meta.banner %>",
56+
mangle: true,
57+
compress: {
58+
sequences : true,
59+
dead_code : true,
60+
conditionals : true,
61+
booleans : true,
62+
unused : true,
63+
if_return : true,
64+
join_vars : true,
65+
drop_console : true
66+
}
67+
},
68+
build: {
69+
files: {
70+
"dist/<%= projectName %>.min.js": "src/<%= projectName %>.js"
71+
}
72+
}
4473
}
4574

4675

4776
});
4877

4978
grunt.registerTask("default", ["eslint","rollup"]);
79+
grunt.registerTask("build",["eslint","rollup","uglify"]);
5080
};

Readme.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
11
#lunar
22

33
> A boilerplate to write plugins in pure JavaScript using ES2015
4+
5+
###Features
6+
* ES2015 support (using rollup.js and Babel)
7+
* UMD supported build
8+
* Automatic versioning using semantic-release
9+
* Test before commiting using ghooks
10+
* Lint using babel-eslint
11+
*
12+

dist/lunar.min.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/*
2+
* lunar - v0.0.0-semantically-released
3+
* A boilerplate to write plugins in pure JavaScript using ES2015
4+
* https://github.com/ritz078/lunar
5+
*
6+
* Made by Ritesh Kumar
7+
* Under MIT License
8+
*/

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"description": "A boilerplate to write plugins in pure JavaScript using ES2015",
55
"main": "dist/lunar.js",
66
"scripts": {
7+
"commit":"git cz",
78
"test": "rollup -c && mocha test/bundle.test.js",
89
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
910
},

0 commit comments

Comments
 (0)