- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.4k
Add external fonts
        Ludovic HENIN edited this page Feb 27, 2016 
        ·
        10 revisions
      
    Adding fonts installed with package manager is quite often task. For instance, using font-awesome or any other similar library is a typical task one will need.
For this purpose, you can go through the following steps:
- In config.ts:
export const FONTS_DEST = `${APP_DEST}/fonts`;
export const FONTS_SRC =[
  'node_modules/bootstrap/dist/fonts/**'
];- For the production build, create a file ./tools/tasks/build.fonts.prod.ts:
import {join} from 'path';
import {FONTS_SRC, FONTS_DEST} from '../config';
export = function buildFonts(gulp, plugins) {
  return function () {
    return gulp
      .src(FONTS_SRC)
      .pipe(gulp.dest(FONTS_DEST));
  };
}- In gulpfile.ts
gulp.task('build.prod', done =>
  runSequence('clean.prod',
              'tslint',
              'build.assets.prod',
              'build.fonts.prod',    // Added task;
              'build.html_css.prod',
              'build.js.prod',
              'build.bundles',
              'build.bundles.app',
              'build.index.prod',
              done));