Ressources included in CSS with a relative path are broken
See original GitHub issueVersions
cli 6.0.0-rc.5
Repro steps
- Create a new projet with last RC
- In
src/style.css
, include a ressource with a relative path, like a font:
@font-face {
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
src: local('Material Icons'),
local('MaterialIcons-Regular'),
url(fonts/material-icons.woff2) format('woff2');
}
Observed behavior
If the ressource is small, it’s inlined with data:
so it works.
If the ressource is big, the path is transformed to an URL relative to the current location, so:
- if you go in the app from the domain (
/
), it works (URL will behttp://www.example.com/material-icons.woff2
) - but if you go directly in some page of the app (like
/page/2
), it fails (URL will behttp://www.example.com/page/material-icons.woff2
)
Desired behavior
Should work.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
GWT ClientBundle CSS doesn't use relative paths to reference ...
GWT ClientBundle CSS doesn't use relative paths to reference images · Project Structure. I define a resource interface like this: · Resource Interface....
Read more >Fixing Broken Relative Links on GitHub Pages | Pluralsight
Look for the resource at company.github.io/static/css/styles.css when you test on GitHub Pages. This is the incorrect resource location. As ...
Read more >Links and Cross References | DocFX website - NET
In DocFX, you can link to a file using its relative path in the source directory. ... If you use file include to...
Read more >An elegant solution of deploying React app into a subdirectory
This is an alternative solution that will help you to deploy your react app into subfolder utilizing native html capabilities.
Read more >What is a URL? - Learn web development | MDN
Such resources can be an HTML page, a CSS document, an image, etc. ... a path like this represented a physical file location...
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 Free
Top 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
@cyrilletuzi many of those options are now available on master. Unfortunately, not the one in question here.
However, a fix has been provided to workaround the underlying issue in the
style-loader
dependency with PR angular/devkit#743 and should be in the next release.This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.