Skip to content

Commit 03d63c6

Browse files
committed
feat(build): add support for svg optimization
1 parent a6ec045 commit 03d63c6

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

templates/common/Gruntfile.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,16 @@ module.exports = function (grunt) {
198198
}]
199199
}
200200
},
201+
svgmin: {
202+
dist: {
203+
files: [{
204+
expand: true,
205+
cwd: '<%%= yeoman.app %>/images',
206+
src: '{,*/}*.svg',
207+
dest: '<%%= yeoman.dist %>/images'
208+
}]
209+
}
210+
},
201211
cssmin: {
202212
// By default, your `index.html` <!-- Usemin Block --> will take care of
203213
// minification. This option is pre-configured if you do not wish to use
@@ -244,7 +254,7 @@ module.exports = function (grunt) {
244254
'*.{ico,png,txt}',
245255
'.htaccess',
246256
'bower_components/**/*',
247-
'images/{,*/}*.{gif,webp,svg}',
257+
'images/{,*/}*.{gif,webp}',
248258
'styles/fonts/*'
249259
]
250260
}, {
@@ -270,6 +280,7 @@ module.exports = function (grunt) {
270280
'coffee',<% if (compassBootstrap) { %>
271281
'compass:dist',<% } %>
272282
'imagemin',
283+
'svgmin',
273284
'htmlmin'
274285
]
275286
},

templates/common/_package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"grunt-contrib-imagemin": "~0.1.4",
1818
"grunt-contrib-watch": "~0.4.0",
1919
"grunt-usemin": "~0.1.11",
20+
"grunt-svgmin": "~0.2.0",
2021
"grunt-rev": "~0.1.0",
2122
"grunt-karma": "~0.4.3",
2223
"grunt-open": "~0.2.0",

0 commit comments

Comments
 (0)