Skip to content

Passing a plain function as a plugin is ignored silently #3934

Description

@vjpr

🐛 Bug Report

Plugins must be paths. If they are functions they are just ignored silently.

Have you read the Contributing Guidelines on issues?

Yes.

To Reproduce

plugins.push(customWebpackPlugin)

function customWebpackPlugin(context, options) {
  console.log('hi')
  return {
    name: 'custom-webpack-plugin',
    configureWebpack(config, isServer, utils) {
		return {}
    },
  }
}

Expected behavior

hi should be printed or a warning shown.

Actual Behavior

Its not, and there is no warning.

Your Environment

  • Docusaurus version used: 2.0.0-alpha.69
  • Environment name and version (e.g. Chrome 78.0.3904.108, Node.js 10.17.0):
  • Operating system and version (desktop or mobile):

Reproducible Demo

(Paste the link to an example repo, including a siteConfig.js, and exact instructions to reproduce the issue.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureThis is not a bug or issue with Docusausus, per se. It is a feature request for the future.mlhMajor League Hacking Fellowship

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions