Skip to content

Commit 8f6d8a7

Browse files
committed
Keepalive WASM webpack build
1 parent 162c2dc commit 8f6d8a7

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

wasm/demo/webpack.config.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ const WasmPackPlugin = require('@wasm-tool/wasm-pack-plugin');
44
const path = require('path');
55
const fs = require('fs');
66

7+
const interval = setInterval(() => console.log('keepalive'), 1000 * 60 * 5);
8+
79
module.exports = {
810
entry: './src/index.js',
911
output: {
@@ -40,6 +42,13 @@ module.exports = {
4042
}),
4143
new WasmPackPlugin({
4244
crateDirectory: path.join(__dirname, '../lib')
43-
})
45+
}),
46+
{
47+
apply(compiler) {
48+
compiler.hooks.done.tap('clearInterval', () => {
49+
clearInterval(interval);
50+
});
51+
}
52+
}
4453
]
4554
};

0 commit comments

Comments
 (0)