CSS paths cannot be resolved in prod
See original GitHub issueI created a theme.scss
file in src
with variables:
$body-background-color: white;
$body-background-image: url("/assets/images/bg-hexa-gray-flat.png");
$body-background-position: top left;
$body-background-repeat: repeat;
$sidepanel-background-color: white;
$sidepanel-background-image: url("/assets/images/bg-hexa-red-flat.png");
$sidepanel-background-position: top left;
$sidepanel-background-repeat: repeat;
It works with npm start
but once I run electron in prod, I get an error file file:///assets/images/bg-hexa-gray-flat.png
not found. How do you make your CSS paths work in prod?
Issue Analytics
- State:
- Created 4 years ago
- Comments:8
Top Results From Across the Web
Debug Local vs Production with CSS path not working on ...
I have this MVC website that I'm a part of. I noticed that the arrow images were not showing up were running LOCALLY...
Read more >css-loader | webpack - JS.ORG
If set to false , css-loader will not parse any paths specified in url or ... All filtered url() will not be resolved...
Read more >CSS
Note: Only absolute paths may be used within CSS custom properties, not relative paths. This is because url() references in custom properties are...
Read more >Java Files - java.nio.file.Files Class
Path represents location of the file and when we create a Path to new file, it does not create actual file until we...
Read more >Content Configuration
Using relative paths. By default Tailwind resolves non-absolute content paths relative to the current working directory, not the tailwind.config.js file.
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 found a solution by adding an alias to the webpack config file:
and then use url like this:
url("~assets/images/bg-hexa-gray-flat.png")
.This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.