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

AWS GenAI LIVE image

How is generative AI increasing efficiency?

Join AWS GenAI LIVE! to find out how gen AI is reshaping productivity, streamlining processes, and driving innovation.

Learn more

Top comments (0)

AWS GenAI LIVE image

Real challenges. Real solutions. Real talk.

From technical discussions to philosophical debates, AWS and AWS Partners examine the impact and evolution of gen AI.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay