Skip to content

Fix remote reload trigger #9

Description

@joemaller

This stopped working at some point 🤷‍♂️

/**
* The "/webpack/reload" endpoint will trigger a full devServer refresh
* Originally from our Browsersync implementation:
*
* https://github.com/ideasonpurpose/wp-theme-init/blob/ad8039c9757ffc3a0a0ed0adcc616a013fdc8604/src/ThemeInit.php#L202
*/
devServer.app.get("/webpack/reload", (req, res) => {
console.log(
chalk.yellow("Reload triggered by request to /webpack/reload"),
);
devServer.sendMessage(
devServer.webSocketServer.clients,
"content-changed",
);
res.json({ status: "Reloading!" });
});

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions