This repository has been archived by the owner on Jul 16, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathGruntfile.js
102 lines (95 loc) · 2.55 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
'use strict';
module.exports = function (grunt) {
// load all grunt tasks
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
// configurable paths
var yeomanConfig = {
src: 'src',
dist: 'dist'
};
try {
yeomanConfig.src = require('./component.json').appPath || yeomanConfig.src;
} catch (e) {
}
grunt.initConfig({
yeoman: yeomanConfig,
clean: {
dist: {
files: [
{
dot: true,
src: [
'!<%= yeoman.dist %>/*',
'!<%= yeoman.dist %>/bower.json',
'!<%= yeoman.dist %>/.git*'
]
}
]
}
},
jshint: {
options: {
jshintrc: '.jshintrc'
},
all: [
'Gruntfile.js',
'<%= yeoman.src %>/{,*/}*.js'
]
},
karma: {
unit: {
configFile: 'karma.conf.js',
singleRun: true
}
},
concat: {
options: {
process: function (src, filepath) {
return '// Source: ' + filepath + '\n' +
src.replace(/(^|\n)[ \t]*('use strict'|"use strict");?\s*/g, '$1');
}
},
dist: {
files: {
'<%= yeoman.dist %>/angular-phonegap.js': [
'<%= yeoman.src %>/PhoneGap.js',
'<%= yeoman.src %>/plugins/*.js'
]
}
}
},
ngmin: {
dist: {
files: [
{
expand: true,
cwd: '<%= yeoman.dist %>',
src: '*.js',
dest: '<%= yeoman.dist %>'
}
]
}
},
uglify: {
dist: {
files: {
'<%= yeoman.dist %>/angular-phonegap.min.js': '<%= yeoman.dist %>/angular-phonegap.js'
}
}
}
});
grunt.registerTask('test', [
'clean:server',
'connect:test',
'karma'
]);
grunt.registerTask('build', [
'clean:dist',
'jshint',
// 'test',
'concat',
'ngmin',
'uglify'
]);
grunt.registerTask('default', ['build']);
};