Replies: 2 comments
-
Hey You can see an example here: https://codesandbox.io/s/reverent-hooks-hkk33?file=/src/styles.css Any image you want to import needs to be in the public folder since that is the starting folder we serve :) |
Beta Was this translation helpful? Give feedback.
-
Thanks @SaraVieira, sorry I wasn't clear - my question was about importing relative local paths (e.g. from the src dir), so that it is handled by the bundling system and resolved at build time to wherever the public path will end up being (usually a cache-busting path where a hash is embedded in the filename). This is standard behavior in create-react-app for instance, but if I try to replicate CRA codebases that depend on this behavior in CSB, I can't seem to get it to work - is this supported in CSB somehow? Thanks! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Is it possible to use url(./relative/path.png) in CSS, like so (in a React project)?
This is a feature of create-react-app, but I couldn't seem to make it work in CSB.
Beta Was this translation helpful? Give feedback.
All reactions