Travis Webb Travis Webb - 1 month ago 5x
Node.js Question

How can I capture the output of a webpack build as a string before it is written to disk?

There seems to be no

option in webpack to write the output as a string, either to a nodejs
or to
. Googling has yielded nothing promising. Is this possible, via either configuration or 3rd-party-module?


After researching, the only way I see to accomplish this would be to monkey-patch webpack's NodeOutputFileSystem.writeFile to capture the string contents.

I ended up using raw babeljs instead of webpack to get the string.