Skip to content

Commit 5437350

Browse files
committed
Grunt uglification
Minified js file
1 parent 08a1065 commit 5437350

File tree

5 files changed

+52
-1
lines changed

5 files changed

+52
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules
2+
npm-debug.log
23
bower_components
34
components

Gruntfile.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/**
2+
* @license HTTP Auth Interceptor Module for AngularJS
3+
* License: MIT
4+
*/
5+
6+
"use strict"
7+
8+
module.exports = function(grunt) {
9+
10+
grunt.initConfig({
11+
pkg: grunt.file.readJSON('package.json')
12+
});
13+
14+
grunt.loadTasks('tasks');
15+
16+
grunt.registerTask('default', function() {
17+
grunt.log.ok("HTTP Auth Interceptor Module for AngularJS");
18+
grunt.log.ok("============================");
19+
grunt.task.run(["uglify"]);
20+
grunt.log.ok("Minified ok");
21+
});
22+
23+
};

package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,11 @@
1616
"angular",
1717
"auth"
1818
],
19-
"homepage": "https://github.com/witoldsz/angular-http-auth"
19+
"homepage": "https://github.com/witoldsz/angular-http-auth",
20+
"devDependencies": {
21+
"grunt": "^0.4.5",
22+
"grunt-contrib-uglify": "^0.11.0",
23+
"load-grunt-config": "^0.19.1",
24+
"time-grunt": "^1.3.0"
25+
}
2026
}

src/http-auth-interceptor.min.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tasks/uglify.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
'use strict';
2+
3+
module.exports = function(grunt) {
4+
grunt.config('uglify', {
5+
build: {
6+
options: {
7+
mangle: false,
8+
compress: true,
9+
banner: "/* <%= pkg.name %> - <%= pkg.version %> / <%= pkg.author %> */"
10+
},
11+
src: ['**/*.js', '!**/*.min.js'],
12+
cwd: 'src',
13+
dest: 'src',
14+
expand: true,
15+
ext: '.min.js',
16+
}
17+
});
18+
19+
grunt.loadNpmTasks('grunt-contrib-uglify');
20+
};

0 commit comments

Comments
 (0)