Closed
Description
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 !