Add webfont support.
Showing
1 changed file
with
28 additions
and
0 deletions
... | @@ -582,6 +582,30 @@ module.exports = function (grunt) { | ... | @@ -582,6 +582,30 @@ module.exports = function (grunt) { |
582 | } | 582 | } |
583 | } | 583 | } |
584 | 584 | ||
585 | if (mpConfig.fonts) { | ||
586 | var fontExtensionPattern = initConfig.fonts.extensions || '{eot,svg,ttf,woff,woff2}'; | ||
587 | initConfig.copy.font = { | ||
588 | files: [{ | ||
589 | expand: true, | ||
590 | dot: true, | ||
591 | cwd: mpConfig.base, | ||
592 | dest: 'dist/build', | ||
593 | src: _.map(mpConfig.fonts.options.dirs, function (value) { | ||
594 | return value + '/{,**/}*.' + fontExtensionPattern; | ||
595 | }), | ||
596 | }] | ||
597 | }; | ||
598 | if (mpConfig.useRev) { | ||
599 | initConfig.rev.font = { | ||
600 | files: { | ||
601 | src: _.map(mpConfig.fonts.options.dirs, function (value) { | ||
602 | return 'dist/build/' + value + '/{,**/}*.' + fontExtensionPattern; | ||
603 | }), | ||
604 | } | ||
605 | }; | ||
606 | } | ||
607 | } | ||
608 | |||
585 | if (mpConfig.bower) { | 609 | if (mpConfig.bower) { |
586 | externalMultiTask('bower', 'run bower externally', 'bower', function(target, options, configFile) { | 610 | externalMultiTask('bower', 'run bower externally', 'bower', function(target, options, configFile) { |
587 | return ['--config.directory=' + options.directory, target]; | 611 | return ['--config.directory=' + options.directory, target]; |
... | @@ -764,6 +788,10 @@ module.exports = function (grunt) { | ... | @@ -764,6 +788,10 @@ module.exports = function (grunt) { |
764 | minifyList.push('svgmin'); // image | 788 | minifyList.push('svgmin'); // image |
765 | revList.push('rev:img'); // image | 789 | revList.push('rev:img'); // image |
766 | } | 790 | } |
791 | if (mpConfig.fonts) { | ||
792 | copyList.push('copy:font'); // font | ||
793 | revList.push('rev:font'); // font | ||
794 | } | ||
767 | //buildList.push('autoprefixer'); // css | 795 | //buildList.push('autoprefixer'); // css |
768 | if (mpConfig.punch) { | 796 | if (mpConfig.punch) { |
769 | copyList.push('concat:generated'); // montyPython | 797 | copyList.push('concat:generated'); // montyPython | ... | ... |
-
Please register or sign in to post a comment