Skip to content

Instantly share code, notes, and snippets.

@mike-zipit
Created May 1, 2019 12:30
Show Gist options
  • Save mike-zipit/151cd88f23694a8d648fca5ae0c5655a to your computer and use it in GitHub Desktop.
Save mike-zipit/151cd88f23694a8d648fca5ae0c5655a to your computer and use it in GitHub Desktop.
Write webpack config to /tmp
return {
// ...
plugins: [
// ...
{
apply(compiler) {
compiler.hooks.beforeRun.tapAsync("WebpackConfig", function(compiler, cb) {
require("fs").writeFileSync("/tmp/webpack.config.new.js", require('util').inspect(compiler.options, {depth: 6, compact: false, sorted: true}), "utf8");
cb();
});
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment