Skip to content

Rework config loading #143

@marvinhagemeister

Description

@marvinhagemeister

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().

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