Skip to content

Commit 0765401

Browse files
committed
wp4 compatible
1 parent 37d92ce commit 0765401

File tree

4 files changed

+10
-13
lines changed

4 files changed

+10
-13
lines changed

dist/index.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

dist/index.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

package.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
{
22
"name": "deploy-server-webpack-plugin",
3-
"version": "0.0.4",
3+
"version": "0.0.5",
44
"description": "A plugin that deploys wepack bundles to server, and Koa as server to receive bundles",
5-
"main": "dist/index.js",
6-
"scripts": {
7-
"babel": "babel ./src -d ./dist --compact --source-maps"
8-
},
5+
"main": "src/index.js",
96
"repository": {
107
"type": "git",
118
"url": "git+https://github.com/mingmingwon/deploy-server-webpack-plugin.git"

src/index.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,16 @@ module.exports = class DeployServerWebpackPlugin {
88
}
99

1010
apply(compiler) {
11-
compiler.plugin('after-emit', (compilation, callback) => {
11+
let afterEmit = (compilation, callback) => {
1212
this.validateConfig(compilation);
1313
this.deployHandler(callback);
14-
});
14+
}
15+
16+
if (compiler.hooks) {
17+
compiler.hooks.afterEmit.tapAsync('afterEmit', afterEmit);
18+
} else {
19+
compiler.plugin('after-emit', afterEmit);
20+
},
1521
}
1622

1723
validateConfig(compilation) {

0 commit comments

Comments
 (0)