-
Notifications
You must be signed in to change notification settings - Fork 112
/
gruntfile.js
149 lines (144 loc) · 4.29 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-terser');
grunt.loadNpmTasks('grunt-bump');
/* grunt.loadNpmTasks('grunt-codepainter'); */
/* grunt.loadNpmTasks('grunt-contrib-yuidoc'); */
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-gh-pages');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-banner');
grunt.loadNpmTasks('grunt-header');
var banner = [
'/* <%= pkg.name %> - v<%= pkg.version %> - ',
'<%= grunt.template.today("yyyy-mm-dd") %> - <%= pkg.homepage %> */\n'
].join('');
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
terser: {
options: {
/* banner: banner, */
/* preserveComments: 'some' */
},
standardTarget: {
files: {
'build/dist/jquery.nanogallery2.min.js': [
'build/dist/jquery.nanogallery2.js'
]
}
},
standardTargetCore: {
files: {
'build/dist/jquery.nanogallery2.core.min.js': [
'src/jquery.nanogallery2.core.js'
]
}
},
standardTargetGoogle3: {
files: {
'build/dist/jquery.nanogallery2.data_google3.min.js': [
'src/jquery.nanogallery2.data_google3.js'
]
}
},
standardTargetFlickr: {
files: {
'build/dist/jquery.nanogallery2.data_flickr.min.js': [
'src/jquery.nanogallery2.data_flickr.js'
]
}
},
standardTargetNanoPhotosProvider2: {
files: {
'build/dist/jquery.nanogallery2.data_nano_photos_provider2.min.js': [
'src/jquery.nanogallery2.data_nano_photos_provider2.js'
]
}
}
},
concat: {
options: {
banner: banner
},
package: {
src: [
'src/jquery.nanogallery2.core.js',
'src/jquery.nanogallery2.data_nano_photos_provider2.js',
'src/jquery.nanogallery2.data_google3.js',
'src/jquery.nanogallery2.data_flickr.js'
],
dest: 'build/dist/jquery.nanogallery2.js'
},
demonstration: {
src: [
'header.html',
'demonstration.html',
'footer.html'
],
dest: 'build/demonstration.html'
}
},
cssmin: {
'build/dist/css/nanogallery2.min.css': 'src/css/nanogallery2.css',
'build/dist/css/nanogallery2.woff.min.css': 'src/css/nanogallery2.woff.css'
},
info: 'header text',
header: {
dist: {
options: {
text: '/* <%= pkg.name %> - v<%= pkg.version %> */'
},
files: {
'build/dist/css/nanogallery2.min.css': 'build/dist/css/nanogallery2.min.css'
}
}
},
'gh-pages': {
options: {
base: 'build',
dotfiles: true,
add: true,
silent: true,
message: '[ci skip]',
user: {
name: 'Kris-B',
email: '[email protected]'
},
branch: 'master',
repo: 'https://' + process.env.GITHUB_API_KEY + '@github.com/nanostudio-org/nanogallery2.git'
},
src: '**/*'
},
usebanner: {
taskName: {
options: {
position: 'top',
banner: '/* <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %> */',
linebreak: true
},
files: {
src: [ 'build/dist/css/nanogallery2.min.css', 'build/dist/*.min.js' ]
}
}
}
});
grunt.registerTask('build-nanogallery2', [
'concat:package',
'terser:standardTarget',
'terser:standardTargetCore',
'terser:standardTargetGoogle3',
'terser:standardTargetFlickr',
'terser:standardTargetNanoPhotosProvider2',
'cssmin',
'usebanner',
/* 'header', */
'gh-pages'
/* 'usebanner' */
/* 'uglify:standardTarget',
'concat:minimalDebug',
'yuidoc',
'copy:redirects' */
]);
}