DEV Community

LG
LG

Posted on

3 3

Webpack devServer : writeToDisk

As per default , webpack devServer will serve bundle in-memory (session) without writing to disk i.e.:

TIP : the following writeToDisk: false is suitable for development mode specifically !

    ...,
    devMiddleware: {
      ...,
      writeToDisk: false, /* default : serve in-memory only */
      ...,
    },
    ...,
Enter fullscreen mode Exit fullscreen mode

Served in-memory & written in-disk (persistency) with respect to any changes within your code base made whilst developing :

    ...,
    devMiddleware: {
      ...,
      writeToDisk: true, /*serve in-memory as you did before but save to disk as well (changes to file[s] respected) */
      ...,
    },
    ...,
Enter fullscreen mode Exit fullscreen mode

NOTE : writeToDisk:<value=false|true> becomes quite useless if explicitly bundled with (npx) webpack bundle prior to any serving done !


Refs

devServer.writeToDisk

Image of Datadog

The Future of AI, LLMs, and Observability on Google Cloud

Datadog sat down with Google’s Director of AI to discuss the current and future states of AI, ML, and LLMs on Google Cloud. Discover 7 key insights for technical leaders, covering everything from upskilling teams to observability best practices

Learn More

Top comments (0)