0
背景画像を表示できないという問題があります。私は反応してWebpackを見ている。残りのscssは正しく動作しています。それは動作している必要がありますように見えるすべてから。私のファイルパスは、次のようになります。 公共>画像> classroom.jpg 公共>スタイルシート>コンポーネント> ReactWebPageBody.scss背景画像の問題
.mainBody{
height: 92vh;
width:100vw;
background-image: url('/images/classroom.jpg');
background-repeat: no-repeat;
background-size: cover;
display: flex;
justify-content: center;
align-items: center;
}
私はhttp://127.0.0.1:8080/images/classroom.jpg 404(見つかりません)
私webpack.configをGET取得しています.jsは次のようになります。
module.exports = {
entry: {
main: './public/app/ReactApp.jsx'
},
output: {
filename: 'bundle.js',
path: './public/scripts'
},
devtool: 'sourcemap',
module: {
loaders: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
loader: 'babel'
},
{
test: /\.s?css$/,
exclude: /node_modules/,
loaders: ["style", "css", "sass"]
}
]
}
};