Skip to content

movePluginBeforeInitAuthPlugin throws error if a plugin is defined as a string and not as an object #55

Closed
@lupas

Description

@lupas

movePluginBeforeInitAuthPlugin() throws an error if plugins are defined only as strings and not as objects, because we currently filter by x.src.

This fails:

plugins: [
      '@/plugins/pluginToMove',
    ],

    extendPlugins(plugins) {
      movePluginBeforeInitAuthPlugin(plugins, 'pluginToMove.js')
      return plugins
    },

This works:

plugins: [
      { src: '@/plugins/pluginToMove', ssr: false },
    ],

    extendPlugins(plugins) {
      movePluginBeforeInitAuthPlugin(plugins, 'pluginToMove.js')
      return plugins
    },

We can improve the function to handle both cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions