I'm using the NET.Core 2.0 Angular template, which work with webpack, angular-cli, angular component, typescript.
I did:
command line - Install package and loader
npm install --save font-awesome
npm install url-loader --save-dev
webpack.config.js - add loader rule
module: {
rules: [
...
{ test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "url-loader" },
{ test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "url-loader" }
]
},
my.component.css - Import to my component
@import '~font-awesome/css/font-awesome.css';
my.component.html - Put the icon
<i class="fa fa-check fa-6"></i>
Now I got no error message but still can't see the icon.
Did I do anything wrong?
~in the import, try:@import '/font-awesome/css/font-awesome.css';Error: Cannot find module "-!../../../../node_modules/css-loader/index.js!./font-awesome/css/font-awesome.css" at webpackMissingModulebut with~is OK.