-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
93 lines (84 loc) · 1.73 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
/**
* Gruntfile for freedom-social-email
*
**/
var path = require('path');
module.exports = function(grunt) {
require('time-grunt')(grunt);
require('jit-grunt')(grunt, {
jasmine_node: 'grunt-jasmine-node2',
'npm-publish': 'grunt-npm'
});
grunt.initConfig({
copy: {
build: {
cwd: 'src/',
src: ['**'],
dest: 'build/',
flatten: false,
filter: 'isFile',
expand: true
},
freedom: {
src: [ require.resolve('freedom') ],
dest: 'build/',
flatten: true,
filter: 'isFile',
expand: true,
onlyIf: 'modified'
}
},
browserify: {
emailjsImap: {
files: {
'build/emailjs-imap.js': [ require.resolve('emailjs-imap-client') ]
},
options: {
browserifyOptions: {
standalone: 'ImapClient'
}
}
},
emailjsSmtp: {
files: {
'build/emailjs-smtp.js': [ require.resolve('emailjs-smtp-client') ]
},
options: {
browserifyOptions: {
standalone: 'SmtpClient'
}
}
}
},
jshint: {
all: ['src/**/*.js', 'spec/**/*.js'],
options: {
jshintrc: true,
ignores: ['src/forge.min.js']
}
},
connect: {
demo: {
options: {
port: 8000,
keepalive: true,
base: ['./', 'build/'],
open: 'http://localhost:8000/build/demo/main.html'
}
}
},
clean: ['build/']
});
grunt.registerTask('build', [
'jshint',
'copy',
'browserify'
]);
grunt.registerTask('demo', [
'build',
'connect'
]);
grunt.registerTask('default', [
'build'
]);
};