travelist / angular2-fontawesome

Angular5 Components and Directives for Fontawesome
MIT License
87 stars 20 forks source link

Angular CLI removes angular2-fontawesome #17

Closed Tahler closed 8 years ago

Tahler commented 8 years ago

Mostly posting here for help, but after running ng build -prod, the angular2-fontawesome files are removed and all of the fontawesome icons on the site are now boxes.

After perusing this link: https://github.com/angular/angular-cli/issues/785 It seems this may be an issue with the structure, especially with there being no main .js file.

Snippet of package.json

"angular2-fontawesome": "^0.5.1",

Snippet of angular-cli-build.js vendorNpmFiles:

'angular2-fontawesome/*.+(js|js.map)',
'angular2-fontawesome/**/*.+(js|js.map)',
'angular2-fontawesome/**/**/*.+(js|js.map)',

Snippet of system-config.ts

// map
'angular2-fontawesome': 'vendor/angular2-fontawesome',
// packages
'angular2-fontawesome': {
  defaultExtension: 'js'
}

Snippet of one of the components using FaDirective

import { FaDirective } from 'angular2-fontawesome/directives';
// ...
directives: [FaDirective],
// ...

and the template

<i fa class="green" [name]="'check'" [size]=4></i>

If anyone has any tips, workarounds, or solutions please let me know.

Tahler commented 8 years ago

Sorry, turns out that it was only an issue with how my server was serving the font-awesome fonts. This is NOT an issue with your code or the Angular CLI.

I am embarrassed and wish I could remove this issue.