Skip to content

Hook to act after others plugins invocation #1754

Closed
@yabab-dev

Description

@yabab-dev

What problem does this feature solve?

(Plugins dev API)

I don't know if this already exists or possible, but I need a method to listen other plugins
invocation inside my plugin, to alter files contents.

Simple use case:

I want to replace default import of PWA plugin (import './registerServiceWorker') to :

if (process.client) require('./registerServiceWorker');

ATM, I use api.postProcessFiles() function, but this one only work if I do:

vue add @vue/pwa
vue add my-plugin

But if I do

vue add my-plugin
vue add @vue/pwa

my-plugin is not aware that PWA was added/invoked, so I cant transform the import statement.

What does the proposed API look like?

Something like api.postProcessFiles()

api.hookPluginInvoke('pluginName', (files) => {})

Thanks !

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions