Travis Webb Travis Webb - 1 year ago 72
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?

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download