12345678910111213141516171819202122232425262728293031323334 |
- "use strict";
- /**
- * @license
- * Copyright Google LLC All Rights Reserved.
- *
- * Use of this source code is governed by an MIT-style license that can be
- * found in the LICENSE file at https://angular.dev/license
- */
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.addFontsToIndex = addFontsToIndex;
- const schematics_1 = require("@angular-devkit/schematics");
- const schematics_2 = require("@angular/cdk/schematics");
- const workspace_1 = require("@schematics/angular/utility/workspace");
- /** Adds the Material Design fonts to the index HTML file. */
- function addFontsToIndex(options) {
- return async (host) => {
- const workspace = await (0, workspace_1.getWorkspace)(host);
- const project = (0, schematics_2.getProjectFromWorkspace)(workspace, options.project);
- const projectIndexFiles = (0, schematics_2.getProjectIndexFiles)(project);
- if (!projectIndexFiles.length) {
- throw new schematics_1.SchematicsException('No project index HTML file could be found.');
- }
- const fonts = [
- 'https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap',
- 'https://fonts.googleapis.com/icon?family=Material+Icons',
- ];
- projectIndexFiles.forEach(indexFilePath => {
- fonts.forEach(font => {
- (0, schematics_2.appendHtmlElementToHead)(host, indexFilePath, `<link href="${font}" rel="stylesheet">`);
- });
- });
- };
- }
- //# sourceMappingURL=material-fonts.js.map
|