forked from conklinbd/playlist
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathGruntfile.js
130 lines (110 loc) · 2.5 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
advSettings: grunt.file.readYAML('data/advancedSettings.yml'),
jshint: {
files: ['source/app/javascript/**/*.js'],
options: {jshintrc: '.jshintrc'}
},
clean: {
build: ['deploy/app/javascript/*'],
jsLib: ['deploy/lib'],
buildTools: ['deploy/resources/buildTools']
},
uglify: {
},
concat: {
options: {
separator: ';'
},
libIE: {
src: ['source/lib/oldIE/**/*.js'],
dest: 'deploy/app/javascript/oldIE.min.js'
}
},
copy: {
map: {
files: [
{
expand: true,
flatten: true,
cwd: '',
src: ['source/lib/**/*.map'],
dest: 'deploy/app/javascript/'
}
]
}
},
requirejs: {
viewer: {
options: {
baseUrl: "source",
paths: {
'dojo': 'empty:',
'esri': 'empty:',
'dijit': 'empty:',
'dojox': 'empty:',
'storymaps': 'app/javascript',
'lib': 'lib'
},
name: 'resources/buildTools/config/ConfigViewer',
out: 'deploy/app/javascript/<%= advSettings.appIdentifier %>-viewer.min.js'
}
}
},
compress: {
user: {
options: {
archive: '<%= advSettings.appIdentifier %>.zip'
},
files: [
{
expand: true,
src: ['deploy/**','samples/**','Readme.pdf','license.txt'],
dest: ''
}
]
},
dev: {
options: {
archive: '<%= advSettings.appIdentifier %>_DevloperDownload.zip'
},
files: [
{
expand: true,
src: ['source/**','data/**','samples/**','Readme.pdf','license.txt','.gitignore','config.rb','Gemfile','Gruntfile.js','package.json'],
dest: ''
}
]
}
}
});
// Load plugins.
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-requirejs');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-compress');
// Default task(s).
grunt.registerTask('default', [
'jshint',
'clean:build',
// Concat external libraries
'concat:libIE',
/*
* Minify project JS using require.js
* - require.js output a .js for with only the viewer and a .js with viewer and builder
* - concat those .js with lib's JS
* - perform production mode replacement in JS files
*/
'requirejs',
'copy',
'clean:jsLib',
'clean:buildTools',
// Zip downloads
'compress'
]);
};