我想将图片加载为background-image
但却失败了。我相信这与我的webpack.config.js有关。这是我的手写笔代码
& .box
background url("/images/center1.jpg") no-repeat right center
-webkit-background-size cover
-moz-background-size cover
-o-background-size cover
background-size cover
这是我的webpack
module: {
loaders: [
{
test: /\.styl$/,
exclude: /(node_modules|bower_components)/,
loader: 'style!css?sourceMap&modules&importLoaders=1&localIdentName=[name]__[local]__[hash:base64:5]!postcss!stylus-loader?resolve url'
},
{
test: /\.(png|jpg|otf)$/,
exclude: /(node_modules|bower_components)/,
loader: 'url-loader?name=[path][name].[ext]&limit=8192'
},
{
test: /\.css$/,
loader: 'style!css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]'
},
{
test: /\.scss$/,
loader: 'style!css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss!sass?resolve url'
}
]
}
我在这里做错了吗?