Closed blankenshipd001 closed 3 years ago
while possible, we usually don't recommend adding the font to the component, as your app will bundle it in. see a similar example here where we opt to use a CDN for the font. also, please format your code in an MD code snippet, so it'll be easier to understand the implementation.
@blankenshipd001 - I see you are trying to put icomoon's font inline as a file in your component. Why not use their production link instead?
We also use icomoon - see our implementation here: https://bit.dev/teambit/design/theme/icons-font/~code/icon-font.tsx https://bit.dev/teambit/design/elements/icon/~code/icon.tsx (using https://bit.dev/teambit/base-ui/elements/icon/~code/base-icon.tsx)
Webpack should be able to bundle it, as a regular asset. Do you think we need some other plugin to handle it?
@KutnerUri This may be the solution. My company has bundled the woff file into the application currently and we are migrating to bit. I'm not sure if they had a specific reason for not using the production download other than I believe it's a custom set of those icons.
Is there a document that tells me how to setup bit harmony to bundle these as an asset?
I'm not sure. @GiladShoham could help.
Anyways, keep in mind that the webpack only bundles a preview. Though it is ugly on bit.dev, It will still work at your original application.
@blankenshipd001 - I just upgraded Webpack and others in #4842. It seems to be working now, can you check?
works AFAIK. reopen if still getting problems.
Describe the bug
We are trying to package our font icons (icomoon) as a component that can be re-used in our apps. When the files are downloaded on the client we receive an error in the devtools console.
Steps to Reproduce
Apply the css class to a component. We were trying within the compositions file.
Expected Behavior
Icon is rendered correctly.
Specifications
for harmony workspace
Additional context
There may be a solution or best practice for this. If so it would be nice to have a link to the example/documentation.
Our desire is just to package up our fonts to be delivered and then have a reusable set of css icon styles that can be reused as an icon component.