-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
63 lines (61 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
/**
* This file is used to build Angular Patch from `src/*`
*
* Installation:
* 1. Install Grunt CLI (`npm install -g grunt-cli`)
* 1. Install Grunt 0.4.0 and other dependencies (`npm install`)
*
* Build:
* Execute `grunt` from root directory of this directory (where Gruntfile.js is)
* To execute automatically after each change, execute `grunt --force default watch`
*
* Result:
* building Angular Patch will create files:
* - dist/angular-patch.js
* - dist/angular-patch.min.js
*
* See http://gruntjs.com/getting-started for more information about Grunt
*/
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
options: {
banner: '/**\n' +
' * <%= pkg.name %> <%= pkg.version %>\n' +
' * \n' +
' * Date: <%= (new Date()).toString() %>\n' +
'*/\n\n'
},
full_js: {
src: [
'src/serverScope.js',
'src/bootstrap.js',
'src/3rdparty/appContext.js',
'src/3rdparty/jsondiffpatch.js',
'src/3rdparty/JSON-Patch/json-patch.js'
],
dest: 'dist/angular-patch.js'
}
},
uglify: {
options: {
banner: '/**\n' +
' * <%= pkg.name %> <%= pkg.version %>\n' +
' * \n' +
' * Date: <%= (new Date()).toString() %>\n' +
'*/\n\n'
},
"dist/angular-patch.min.js": [ "dist/angular-patch.js" ]
},
watch: {
files: ['src/*'],
tasks: ['concat', 'uglify']
}
});
// Default task.
grunt.registerTask('default', ['concat', 'uglify']);
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
};