Skip to content

Conversation

@tamara027
Copy link

No description provided.

function addFontDeclaration (fontName, postCssRoot, enforcedSvgHeight, svgPaths) {
// The options are passed as a query string so we use the relative svg paths to reduce the path length per file
const options = { svgs: svgPaths.relative, name: fontName, enforcedSvgHeight: enforcedSvgHeight };
const options = { svgs: svgPaths.resolved, name: fontName, enforcedSvgHeight: enforcedSvgHeight };
Copy link
Owner

@jantimon jantimon Mar 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should use only relative paths here.. otherwise webpack won't be able to share caches

@LucaColonnello
Copy link

LucaColonnello commented Sep 29, 2022

Is there any update on this @tamara027 / @jantimon ?
I'm trying to upgrade to webpack 5 and iconfont is not working with assets modules.

This looks like the thing we need?
(Also thanks for the work here!)

@ambienthack
Copy link

I managed (by trial and error) to make it work in webpack 5.87.0 by removing double quotes on this line:

const url = 'data:application/x-font-woff;charset=utf-8;base64,' + result;

I'm not an expert in webpack, not sure if this is conceptually correct (and why it works 😀).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants