Webpack plugin that reloads the separated react-app on browser after your app was builded and runs the docker image to start your own app with .umd static files
Please note, that you must insert the plugin's requirements to your separated react-app
Please note, that this is works only in Linux and MacOs machine (windows 10 PRO maybe but was not tested)
Plugin required environments:
PLT_IMAGE_PORT - port of your "watching app"
PLT_IMAGE_NAME - docker image name that will watcher run to server files via nginx
PLT_STREAM_SEND_PORT - the port to send web-socket messages
Insert the websocket server in the separate react-app
// webpackDevServer.config.jsconstWebSocket=require('ws')constwss=newWebSocket.Server({port: 5010})module.exports=function(proxy,allowedHost){return{// other settingsbefore(app,server){// create the connectionwss.on('connection',ws=>{// get trigger messagews.on('message',message=>// reload page server.sockWrite(server.sockets,'content-changed'))})// other settings},};};
Example of usage
// webpack.config.jsconstPlatformBuildWithWatchPlugin=require('@mihanizm56/webpack-stream-watcher');module.exports={// your config ...plugins: [newPlatformBuildWithWatchPlugin()]};