Skip to content

Instantly share code, notes, and snippets.

@JefCurtis
Last active September 12, 2018 17:34
Show Gist options
  • Select an option

  • Save JefCurtis/4dab69c5ab868682fee41b0f8c5a9d25 to your computer and use it in GitHub Desktop.

Select an option

Save JefCurtis/4dab69c5ab868682fee41b0f8c5a9d25 to your computer and use it in GitHub Desktop.
Gmail add-on: Copy Webpack plugin. Hook after emit.
const exec = require("child_process").exec;
[...]
module.exports = {
[...]
plugins: [
[...]
new CopyWebpackPlugin([
{ from: join(root, "config/dev/.clasp.json"), to: ".", ToType: "file" },
]),
{
apply: compiler => {
compiler.hooks.afterEmit.tap("AfterEmitPlugin", () => {
exec("yarn push", (_, stdout, stderr) => {
if (stdout) process.stdout.write(stdout);
if (stderr) process.stderr.write(stderr);
});
});
},
},
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment