checkout - dist/index.html has been created.
Showing
2 changed files
with
98 additions
and
23 deletions
... | @@ -23,6 +23,22 @@ module.exports = function (grunt) { | ... | @@ -23,6 +23,22 @@ module.exports = function (grunt) { |
23 | }] | 23 | }] |
24 | }, | 24 | }, |
25 | }, | 25 | }, |
26 | copy: { | ||
27 | dist: { | ||
28 | files: [{ | ||
29 | expand: true, | ||
30 | dot: true, | ||
31 | cwd: 'src', | ||
32 | dest: 'dist', | ||
33 | src: [ | ||
34 | 'WEB-INF/{,*/}*.*', | ||
35 | '*.{ico,png,txt}', | ||
36 | '.htaccess', | ||
37 | '{,*/}*.html', | ||
38 | ] | ||
39 | }] | ||
40 | }, | ||
41 | }, | ||
26 | }; | 42 | }; |
27 | var checkList = []; | 43 | var checkList = []; |
28 | var buildList = [ | 44 | var buildList = [ |
... | @@ -136,35 +152,92 @@ module.exports = function (grunt) { | ... | @@ -136,35 +152,92 @@ module.exports = function (grunt) { |
136 | }, | 152 | }, |
137 | }; | 153 | }; |
138 | buildList.push('punch:generate'); | 154 | buildList.push('punch:generate'); |
155 | initConfig.copy.dist.files.push({ | ||
156 | expand: true, | ||
157 | dot: true, | ||
158 | cwd: '.grunt/holygrail/punch/output-generate', | ||
159 | dest: 'dist', | ||
160 | src: [ | ||
161 | '{,*/}*.html', | ||
162 | ] | ||
163 | }); | ||
164 | } | ||
165 | |||
166 | if (true) { | ||
167 | initConfig.useminPrepare = { | ||
168 | options: { | ||
169 | dest: 'dist' | ||
170 | }, | ||
171 | html: { | ||
172 | options: { | ||
173 | staging: '.grunt/usemin', | ||
174 | }, | ||
175 | src: holyGrailTmp + '/punch/output-generate/{,**/}*.html', | ||
176 | }, | ||
177 | }; | ||
178 | initConfig.usemin = { | ||
179 | options: { | ||
180 | dirs: ['dist'] | ||
181 | }, | ||
182 | html: { | ||
183 | options: { | ||
184 | dirs: ['dist'], | ||
185 | assetsDirs: ['dist'], | ||
186 | }, | ||
187 | src: ['dist/!(scripts){,**/}*.html'], | ||
188 | }, | ||
189 | }; | ||
190 | initConfig.clean.dist.files[0].src.push('.grunt/usemin'); | ||
191 | initConfig.htmlmin = { | ||
192 | dist: { | ||
193 | //options: _.extend({}, common.htmlmin.options), | ||
194 | files: [{ | ||
195 | expand: true, | ||
196 | cwd: 'dist', | ||
197 | src: '{,*/}*.html', | ||
198 | dest: 'dist' | ||
199 | }] | ||
200 | } | ||
201 | }; | ||
139 | } | 202 | } |
140 | 203 | ||
204 | initConfig.copy.css: { | ||
205 | files: [{ | ||
206 | expand: true, | ||
207 | dot: true, | ||
208 | cwd: 'src', | ||
209 | dest: '.grunt/usemin-css/', | ||
210 | src: _.map(common.css.options.dirs, function (value) { | ||
211 | return value + '/{,**/}*.css'; | ||
212 | }), | ||
213 | }] | ||
214 | }; | ||
215 | initConfig.clean.dist.files[0].src.push('.grunt/usemin-css'); | ||
141 | 216 | ||
142 | buildList.push('useminPrepare'); // html | 217 | buildList.push('useminPrepare'); // html |
143 | //buildList.push('usemin:views' | 218 | //buildList.push('usemin:views' |
144 | buildList.push('requirejs'); // script | 219 | //buildList.push('requirejs'); // script |
145 | buildList.push('copy:css'); // css | 220 | buildList.push('copy:css'); // css |
146 | buildList.push('imagemin'); // image | 221 | //buildList.push('imagemin'); // image |
147 | buildList.push('svgmin'); // image | 222 | //buildList.push('svgmin'); // image |
148 | buildList.push('rev:img'); // image | 223 | //buildList.push('rev:img'); // image |
149 | buildList.push('autoprefixer'); // css | 224 | //buildList.push('autoprefixer'); // css |
150 | /* | 225 | //buildList.push('concat:requirejs'); // montyPython |
151 | 'concat:requirejs', // montyPython | 226 | buildList.push('concat:generated'); // montyPython |
152 | 'concat:generated', // montyPython | 227 | //buildList.push('cssmin'); // montyPython |
153 | 'cssmin', // montyPython | 228 | //'uglify:dist'); |
154 | //'uglify:dist', | 229 | buildList.push('copy:dist'); |
155 | 'copy:dist', | 230 | //'modernizr'); |
156 | //'modernizr', | 231 | //buildList.push('uglify:generated'); // montyPython |
157 | 'uglify:generated', // montyPython | 232 | //'rev:dist'); // montyPython |
158 | //'rev:dist', // montyPython | 233 | //buildList.push('rev:css'); // montyPython |
159 | 'rev:css', // montyPython | 234 | //buildList.push('revconfig'); // montyPython |
160 | 'revconfig', // montyPython | 235 | //buildList.push('uglify:bower'); // montyPython |
161 | 'uglify:bower', // montyPython | 236 | //buildList.push('uglify:requireconfig'); // montyPython |
162 | 'uglify:requireconfig', // montyPython | 237 | //buildList.push('rev:requireconfig'); // montyPython |
163 | 'rev:requireconfig', // montyPython | 238 | buildList.push('usemin:html'); // montyPython |
164 | 'usemin:html', // montyPython | 239 | //buildList.push('usemin:css'); // montyPython |
165 | 'usemin:css', // montyPython | 240 | buildList.push('htmlmin'); // montyPython |
166 | 'htmlmin', // montyPython | ||
167 | */ | ||
168 | 241 | ||
169 | grunt.initConfig(initConfig); | 242 | grunt.initConfig(initConfig); |
170 | 243 | ... | ... |
... | @@ -17,6 +17,8 @@ | ... | @@ -17,6 +17,8 @@ |
17 | "dependencies": { | 17 | "dependencies": { |
18 | "grunt": "~0", | 18 | "grunt": "~0", |
19 | "grunt-contrib-clean": "~0", | 19 | "grunt-contrib-clean": "~0", |
20 | "grunt-contrib-concat": "~0", | ||
21 | "grunt-contrib-copy": "~0", | ||
20 | "grunt-contrib-csslint": "~0", | 22 | "grunt-contrib-csslint": "~0", |
21 | "grunt-contrib-jshint": "~0", | 23 | "grunt-contrib-jshint": "~0", |
22 | "grunt-contrib-htmlmin": "~0", | 24 | "grunt-contrib-htmlmin": "~0", | ... | ... |
-
Please register or sign in to post a comment