Webpack generates wrong paths for fonts in css
See original GitHub issueReferencing a font-face for a local file produces wrong paths when using run build.
Example structure:
/src
/assets
/fonts
fonts.css
font.ttf
In fonts.css i reference the font as url(./font.ttf)
since they’re in the same directory. After run build it produces the following css in static/css.
url(./static/media/font.ttf)
build folder structure
/static
/css
main.css
/media
font.ttf
So the css is looking for the font file in css/static/media/font.tff
, when it should really be ../media/font.ttf
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:8 (7 by maintainers)
Top Results From Across the Web
Font urls path is wrong and includes css path after WebPack ...
I'm having MiniCssExtractPlugin create css or less files encountered. I am importing a less and a css file in src/client/index.tsx: import './ ...
Read more >Fontawesome with webpack and Laravel 5.4, wrong path to ...
I want to get some fonts loaded to my app, but I have just issues. Before I used gulp and everything worked fine....
Read more >MiniCssExtractPlugin - webpack
This plugin extracts CSS into separate files. It creates a CSS file per JS file which contains CSS. It supports On-Demand-Loading of CSS...
Read more >Loading Fonts with webpack - Chris Courses
If webpack finds any font files being referenced inside of any CSS files being pulled into app.js , it'll duplicate the font files,...
Read more >@daipeng7/iconfont-webpack-plugin - npm
Default value: [path of cssOutput] + /font-preview.html . Or false value. Destination for generated html-preview file (file name). If false , no ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I can’t reproduce this with default settings.
Do you have a
homepage
field inpackage.json
? If yes, what is it set to?./