Skip to content
This repository has been archived by the owner on Mar 17, 2021. It is now read-only.

Version 3 without limit option? #308

Closed
frafajec opened this issue Dec 20, 2018 · 1 comment · Fixed by #309
Closed

Version 3 without limit option? #308

frafajec opened this issue Dec 20, 2018 · 1 comment · Fixed by #309

Comments

@frafajec
Copy link

frafajec commented Dec 20, 2018

  • Operating System: osX 10.14.2
  • Node Version: 8.12.0
  • NPM Version: 6.4.1
  • webpack Version: 4.28.0
  • file-loader Version: 3.0.0

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!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants