forked from daysofwonder/asmodeenet_sso_js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
103 lines (95 loc) · 2.87 KB
/
Gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
// Generated on 2015-08-17 using generator-angular 0.11.1
'use strict';
// var modRewrite = require('connect-modrewrite');
// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec/**/*.js'
module.exports = function (grunt) {
// Load grunt tasks automatically
require('load-grunt-tasks')(grunt);
grunt.loadNpmTasks('grunt-rev-package');
grunt.loadNpmTasks('grunt-contrib-coffee');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-watch');
// Define the configuration for all the tasks
grunt.initConfig({
connect: {
server: {
options: {
keepalive: true
}
},
server_dev: {
options: {
keepalive: false
}
},
options: {
base: './examples/',
port: 8080,
}
},
uglify: {
options: {
compress: {
dead_code: true,
unused: true,
},
report: 'gzip',
preserveComments: false
},
my_target: {
files: {
'build/an_sso.min.js': ['build/an_sso.built.js']
}
}
},
concat: {
dist: {
src: ['build/an_sso.cf.js', 'build/utils.cf.js', 'build/ajax.cf.js', 'ext/jws-3.3.js', 'ext/crypto-1.1.js', 'ext/base64x-1.1.js', 'ext/rsa.js', 'ext/rsasign-1.2.js', 'ext/keyutil-1.0.js'],
dest: 'build/an_sso.built.js',
},
jwt: {
src: ['ext/base64-min.js', 'ext/jsbn-min.js', 'ext/json-sans-eval-min.js', 'ext/cryptojs-312-core-fix-min.js', 'ext/hmac-sha256.js', 'build/an_sso.min.js'],
// src: ['ext/jsrsasign-latest-all-min.js', 'build/an_sso.min.js'],
dest: 'dist/an_sso.min.js'
}
},
revPackage: {
'ana': 'dist/an_sso.min.js'
},
coffee: {
compileWithMaps: {
files: {
'build/an_sso.cf.js': 'src/an_sso.coffee',
'build/ajax.cf.js': 'src/ajax.coffee',
'build/utils.cf.js': 'src/utils.coffee'
}
}
},
watch: {
all: {
files: ['src/*.coffee'],
tasks: ['build']
}
}
});
grunt.registerTask('serve', ['connect:server']);
grunt.registerTask('build', [
'coffee',
'concat:dist',
'uglify',
'concat:jwt',
'revPackage'
]);
grunt.registerTask('serve-dev', [
'build',
'connect:server_dev',
'watch'
]);
grunt.registerTask('default', [
'build'
]);
};