webpack-contrib / file-loader

File Loader
MIT License
1.86k stars 257 forks source link

Version 3 without `limit` option? #308

Closed frafajec closed 5 years ago

frafajec commented 5 years ago

Expected Behavior

Expected limit to be allowed in options?

Actual Behavior

ValidationError: File Loader Invalid Options
options should NOT have additional properties

Code

  // webpack.config.js
  font: {
    test: /\.(eot|otf|ttf|woff|woff2)(\?.*)?$/,
    loader: 'file-loader',
    options: {
      limit: 3072, // removed with file-loader 3.0.0?
      name: `fonts/${staticMedia}`,
    },
  },
  file: {
    test: [/\.ico$/, /\.gif$/, /\.jpe?g$/, /\.png$/],
    loader: require.resolve('url-loader'),
    options: {
      limit: 10000, // anything above 10kb gets passed to file-loader implicitly
      name: `static/f_${staticMedia}`,
    },
  },

How Do We Reproduce?

Im trying to update from 2.0.0 version and this now crashes build straight out. With exact same setup it works on 2. (note, this package upgrade is the only change) If I remove limit from options, it works like charm. Both dev and prod builds fail.

Thanks!

alexander-akait commented 5 years ago

Already WIP on this