1762cff9 by Adam Heath

Add webfont support.

1 parent fe88d5c6
......@@ -582,6 +582,30 @@ module.exports = function (grunt) {
}
}
if (mpConfig.fonts) {
var fontExtensionPattern = initConfig.fonts.extensions || '{eot,svg,ttf,woff,woff2}';
initConfig.copy.font = {
files: [{
expand: true,
dot: true,
cwd: mpConfig.base,
dest: 'dist/build',
src: _.map(mpConfig.fonts.options.dirs, function (value) {
return value + '/{,**/}*.' + fontExtensionPattern;
}),
}]
};
if (mpConfig.useRev) {
initConfig.rev.font = {
files: {
src: _.map(mpConfig.fonts.options.dirs, function (value) {
return 'dist/build/' + value + '/{,**/}*.' + fontExtensionPattern;
}),
}
};
}
}
if (mpConfig.bower) {
externalMultiTask('bower', 'run bower externally', 'bower', function(target, options, configFile) {
return ['--config.directory=' + options.directory, target];
......@@ -764,6 +788,10 @@ module.exports = function (grunt) {
minifyList.push('svgmin'); // image
revList.push('rev:img'); // image
}
if (mpConfig.fonts) {
copyList.push('copy:font'); // font
revList.push('rev:font'); // font
}
//buildList.push('autoprefixer'); // css
if (mpConfig.punch) {
copyList.push('concat:generated'); // montyPython
......