Skip to content

Commit

Permalink
file-loaderでcssのbackground-imageを表示させる
Browse files Browse the repository at this point in the history
  • Loading branch information
hakozaru committed Oct 11, 2021
1 parent c5d7b0b commit 5e9b733
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"@types/react-dom": "^17.0.9",
"case-sensitive-paths-webpack-plugin": "^2.4.0",
"css-loader": "^6.3.0",
"file-loader": "^6.2.0",
"sass": "^1.42.1",
"sass-loader": "^12.1.0",
"style-loader": "^3.3.0",
Expand Down
11 changes: 10 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,16 @@ module.exports = {
},
{
test: /\.(png)$/,
type: "asset/resource"
use: [
{
loader: 'file-loader',
options: {
name: './images/[name].[ext]'
}
}
],
type: 'javascript/auto',
dependency: { not: ['url'] }
},
{
test: /\.(svg)$/,
Expand Down
8 changes: 8 additions & 0 deletions yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5e9b733

Please sign in to comment.