Webpack - background images not loading

后端 未结 8 1874
渐次进展
渐次进展 2020-12-09 15:34

I\'m fairly new to webpack but having some problems with css-loader or file-loader.

I\'m trying to load a background-image but it doesn\'t work quite right. The bac

8条回答
  •  悲哀的现实
    2020-12-09 15:59

    There is currently a bug when using sourceMap with css-loader. Removing sourceMap from your css loader should fix it.

    "module": {
        "loaders": [
            {
                "test": /\.scss$/,
                "loaders": ["style", "css", "sass?sourceMap"]
            },
            { 
                test: /\.jpg$/, 
                loader: "file-loader" 
            }
        ]
    }
    

    Issue is related to: https://github.com/webpack/css-loader/issues/296

提交回复
热议问题