Skip to content

Commit

Permalink
wp4 compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
mingmingwon committed Sep 29, 2019
1 parent 37d92ce commit 0765401
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
5 changes: 0 additions & 5 deletions dist/index.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/index.js.map

This file was deleted.

7 changes: 2 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
{
"name": "deploy-server-webpack-plugin",
"version": "0.0.4",
"version": "0.0.5",
"description": "A plugin that deploys wepack bundles to server, and Koa as server to receive bundles",
"main": "dist/index.js",
"scripts": {
"babel": "babel ./src -d ./dist --compact --source-maps"
},
"main": "src/index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/mingmingwon/deploy-server-webpack-plugin.git"
Expand Down
10 changes: 8 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,16 @@ module.exports = class DeployServerWebpackPlugin {
}

apply(compiler) {
compiler.plugin('after-emit', (compilation, callback) => {
let afterEmit = (compilation, callback) => {
this.validateConfig(compilation);
this.deployHandler(callback);
});
}

if (compiler.hooks) {
compiler.hooks.afterEmit.tapAsync('afterEmit', afterEmit);
} else {
compiler.plugin('after-emit', afterEmit);
},
}

validateConfig(compilation) {
Expand Down

0 comments on commit 0765401

Please sign in to comment.