Skip to content

Unable to use loglevel in version 4.0.2 #774

Description

@goelshobhit
  • Operating System: window 10
  • Node Version: 14.15.0
  • NPM Version: 6.14.8
  • webpack Version: 5.6.0
  • webpack-dev-middleware Version:4.0.2

Expected Behavior

Should be able to use other options inside webpackDevMiddleware apart from below options.

schema: {
type: 'object',
properties: {
mimeTypes: { type: 'object' },
writeToDisk: { anyOf: [ { type: 'boolean' }, { instanceof: 'Function' } ] },
methods: { type: 'array', items: { type: 'string' } },
headers: { type: 'object' },
publicPath: { type: 'string' },
serverSideRender: { type: 'boolean' },
outputFileSystem: { type: 'object' },
index: { anyOf: [ { type: 'boolean' }, { type: 'string' } ] }
},
additionalProperties: false
},
Screenshot (30)
Screenshot (31)

Actual Behavior

If i am using loglevel as a option. it throws error

      schemaPath: '#/additionalProperties',
      params: { additionalProperty: 'logLevel' },
      message: 'should NOT have additional properties',

Code

function createWebpackMiddleware(compiler, publicPath) {
  const options = {
    logLevel: 'warn',
    publicPath,
  };
  return webpackDevMiddleware(compiler, options);
}

How to reproduce.

  • upgrade the webpack and webpack-dev-middleware version to the latest.
  • if you pass loglevel as a options inside webpack-dev-middleware, you get the above issue on the terminal

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions