jaredpalmer / jaredpalmer/presspack

Error with using background-image: url('some.jpg');

Open
#33 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
683
Forks
80
PR merge metrics
No merged PRs in 30d

Description

I got an error after adding a css rule with backgroung-image: url(some.jpg). After searching a bit I fix it by adding file-loader (yarn add file-loader --dev) and adding this to webpack.config.js rules:
{
test: /\.(png|jpe?g|gif)$/i,
use: [
{
loader: 'file-loader',
},
],
},

It's working but I don't know if it's a good solution.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with webpack.config.js and the CSS rule using background-image: url(some.jpg); reproduce the reported asset-loading error. Determine whether the file-loader configuration is the repository-supported approach, then verify the recommended setup resolves the build error and document the result.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, javascript, webpack
Domain
build-system, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.