I wanted to intercept the connection from wds to client on every change so that before it refreshes/hot reloads I want to fetch a token which can be injected to the angular app. I've added a preprocesor middleware to the webpack dev server using the devServer.setup(). That takes care of intercepting the connection.
But how do I pass those value from dev server into the app?!
I was thinking of using definePlugin in the webpack.config. But the variables defined there are not accessible in the wds server.
Is there any other way I could pass or inject these token into the app during compile time?! That brings me to another question, is wds express middleware invoked after the files are compiled or before that?!