Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Rework config loading #143

Closed
marvinhagemeister opened this issue Oct 5, 2020 · 2 comments
Closed

Rework config loading #143

marvinhagemeister opened this issue Oct 5, 2020 · 2 comments

Comments

@marvinhagemeister
Copy link
Member

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

@developit
Copy link
Member

I started on this a little bit in #169 (needs to be factored into a separate PR). Still needs the package.json loading.

@marvinhagemeister
Copy link
Member Author

Closing since the config file handling has been greatly improved since this issue was created. We now support wmr.config.* config file 👍

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants