amireh/happypack

doesn't work well with url-loader to load font

オープン

#197 opened on 2017/11/13

 (3 件のコメント) (4 件のリアクション) (0 人の担当者)JavaScript (127 件のフォーク)batch import
help wanted

Repository metrics

Stars
 (4,233 個のスター)
PR merge metrics
 (30d に merged PR はありません)

説明

I didn't remember changes related to this, however the url-loader fails suddenly with happypack. Following is my current webpack config:

plugins: [
 new HappyPack({
      id: 'font',
      threads: 4,
      loaders: [ 'url-loader?limit=200000&mimetype=application/font-woff' ]
    }),
],
module: {
  rules: [
     {
        test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
        loader: 'happypack/loader?id=font'
     }
]
}

And here is how I use it,

@font-face {
  font-family: 'FontAwesome';
  src: url('../fonts/fontawesome-webfont.woff?v=4.7.0') format('woff');
  font-weight: normal;
  font-style: normal;
}

result is, it doesn't work and give me warnings

Failed to decode downloaded font OTS parsing error: incorrect file size in WOFF header

Any help ?

コントリビューターガイド