Copying from slack:
- load configs up-front before calling into
build() or start()
start() sets up file watcher for package.json. Successfully parsed file changes emit a configChange event on options.bus
middleware() listens for that event, and invokes a special configUpdated(newConfig) hook on all plugins.
(If necessary, we can also listen for the event and fire the hook in the second RollupPluginContainer used by the CSS middleware)
this also nicely keeps the initial package.json + wmr.config.js parsing as a one-time (non-watch) thing that happens prior to build()/start().
Copying from slack:
build()orstart()start()sets up file watcher forpackage.json. Successfully parsed file changes emit aconfigChangeevent onoptions.busmiddleware()listens for that event, and invokes a specialconfigUpdated(newConfig)hook on all plugins.(If necessary, we can also listen for the event and fire the hook in the second RollupPluginContainer used by the CSS middleware)
this also nicely keeps the initial package.json + wmr.config.js parsing as a one-time (non-watch) thing that happens prior to build()/start().