没有显示的铁笔背景图象

时间:2016-06-17 02:13:46

标签: webpack stylus

我想将图片加载为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'
            }
        ]
}

我在这里做错了吗?

0 个答案:

没有答案