LoginSignup
3
2

More than 5 years have passed since last update.

WebpackでcssのsourceMapを使ったとき背景画像が表示されない

Posted at

こうやってsourceMapを作る設定にしていると、
cssの背景が表示されない。

module: {
    loaders: [
      {
        test: /\.less$/,
        loader: 'style-loader!css-loader?sourceMap!less-loader'
      },
    ]
}

同じ症状の人
https://github.com/webpack/css-loader/issues/29

【解決案】
https://github.com/webpack/style-loader/issues/55

このページのように、publicPathをこんな感じで書いていると駄目

  output: {
    publicPath: '/static/'
  },

ホストを追加するといけた。

  output: {
    publicPath: 'http://localhost:3000/static/'
  },

よくわからん

3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2