Closed Dahie closed 3 years ago
Thanks for filing this issue…it turns out there was a bug! It was due to a breaking change between css-loader
v3 and v4. I've authored a fix in PR #240. In the meantime, you can update your webpack.config.js
file like so:
"css-loader",
within the module rules for /\.(s[ac]|c)ss$/
{
loader: "css-loader",
options: {
url: url => !url.startsWith('/')
}
},
That should hopefully fix your problem.
Awesome, thank you!
Oh yeah, and it's working.
Motivation
I'm playing with bridgetown. I created a fresh new site using bridgetown 0.19.2, added a few pictures to
src/images/
and I can embed them in the frontend. I want to use one of the pictures as a background image of a style element.Documentation says "You can reference them from both markup and CSS simply using a relative URL (for example, /images/logo.svg)."
So, I changed the default
frontend/styles/style.scss
and addedNow, I run
yarn start
and get this error when webpacker tries to compile the styles:I run Ruby 3.0 on OSX 11.2
Suggestion
I don't know if this is a bug or if I misunderstood the documentation.
If it's the latter I'd like to know what I did wrong and help to find better wording in the docs.
Thanks for your help