Created
May 1, 2019 12:30
-
-
Save mike-zipit/151cd88f23694a8d648fca5ae0c5655a to your computer and use it in GitHub Desktop.
Write webpack config to /tmp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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