Skip to content
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:

  1. In config.ts:
export const FONTS_DEST = `${APP_DEST}/fonts`;
export const FONTS_SRC =[
  'node_modules/bootstrap/dist/fonts/**'
];
  1. 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));
  };
}
  1. 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));
Clone this wiki locally