I am running Angular 8 with the Custom Webpack builder.
"builder": "@angular-builders/custom-webpack:browser",
I have a reference to the ngx-datatable
, and I reference the css
as follows:
@import '~@swimlane/ngx-datatable/release/assets/icons.css';
That referenced css file has a font-face like so:
@font-face {
font-family: "data-table";
src:url("fonts/data-table.eot");
src:url("fonts/data-table.eot?#iefix") format("embedded-opentype"),
url("fonts/data-table.woff") format("woff"),
url("fonts/data-table.ttf") format("truetype"),
url("fonts/data-table.svg#data-table") format("svg");
font-weight: normal;
font-style: normal;
What I want to do is inline the data-table font file into my webpack'd build. My understanding is that, after installing the base64-inline-loader, I should be able to have a custom webpack config that looks like this:
module.exports = {
module: {
rules: [
{
test: /\.(jpe?g|png|ttf|eot|svg|woff(2)?)(\?[a-z0-9=&.]+)?$/,
use: 'base64-inline-loader'
}
]
}
};
However, after running the build, nothing gets inlined, and I can see the browser is making a request to
http://localhost:4200/data-table.woff
It's not clear to me how to fix this. My understanding is that for files like .png, .woff, .eot, etc, the default Angular webpack configuration will use the file-loader, which will spit out a hashed version of the file in the dist directory. However even after adding the base64-inline-loader, I am still seeing the files get copied and hashed, instead of inlined.
Edit
I believe my problem is related to Angular 7, svg and sass how to set relative path, but I'm still not sure how to fix it.