direflow icon indicating copy to clipboard operation
direflow copied to clipboard

Direflow re-build on the fly to file

Open lukasz-devkick opened this issue 3 years ago • 1 comments

We use direflow in a very specific way in our project. Currently we are during migration legacy code to new react code. We use a strangler pattern, so currently, the new code is a dependency to the old repository.

I opaqued it both in the docker and docker-compose containers, which syncs direflowBundle.js built on watcher. Because legacy application loads the direflowBundle I can't use provided developement server.

Is it possible to run the server with auto-rebuild to direflowBundle.js instead of syncing with the browser?

lukasz-devkick avatar Jul 21 '21 15:07 lukasz-devkick

Hi @lduraj90 ,

One thing you can try is to tell the webpack dev server to write the file to disk instead of the default of keeping it in memory.

In your config-overrides.js:

{
  devServer: (configFunction) => {
      return (proxy, allowedHost) => {
          const config = configFunction(proxy, allowedHost);
	  config.writeToDisk = true;
          return config;
     }
  }
  ...
}

yaya-bhavik avatar Jul 29 '21 20:07 yaya-bhavik