Skip to content

Commit 2748d53

Browse files
author
evilebottnawi
committed
chore: prepare 1.0.5 release
1 parent c45d396 commit 2748d53

4 files changed

Lines changed: 526 additions & 169 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44

55
This project adheres to [Semantic Versioning](http://semver.org).
66

7+
## 1.0.5 - 2018-03-07
8+
9+
* Refactor: reduce memory usage and increase performance.
10+
711
## 1.0.4 - 2018-02-27
812

913
* Fixed: compatibility with `webpack >= 4.0.0`.

index.js

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -116,56 +116,56 @@ class ChildProcessWebpackPlugin {
116116

117117
const plugin = { name: "ExecaPlugin" };
118118

119-
const compileFn = () => {
120-
if (this.options.onBuildStart.length > 0) {
119+
if (this.options.onBuildStart.length > 0) {
120+
const compileFn = () => {
121121
this.execute(this.options.onBuildStart);
122122

123123
if (this.options.dev) {
124124
this.options.onBuildStart = [];
125125
}
126-
}
127-
};
126+
};
128127

129-
if (compiler.hooks) {
130-
// Information: `beforeRun.asyncTap` in future major
131-
compiler.hooks.compile.tap(plugin, compileFn);
132-
} else {
133-
compiler.plugin("compile", compileFn);
128+
if (compiler.hooks) {
129+
// Information: `beforeRun.asyncTap` in future major
130+
compiler.hooks.compile.tap(plugin, compileFn);
131+
} else {
132+
compiler.plugin("compile", compileFn);
133+
}
134134
}
135135

136-
const afterEmitFn = (compilation, callback) => {
137-
if (this.options.onBuildEnd.length > 0) {
136+
if (this.options.onBuildEnd.length > 0) {
137+
const afterEmitFn = (compilation, callback) => {
138138
this.execute(this.options.onBuildEnd);
139139

140140
if (this.options.dev) {
141141
this.options.onBuildEnd = [];
142142
}
143-
}
144143

145-
callback();
146-
};
144+
callback();
145+
};
147146

148-
if (compiler.hooks) {
149-
compiler.hooks.afterEmit.tapAsync(plugin, afterEmitFn);
150-
} else {
151-
compiler.plugin("after-emit", afterEmitFn);
147+
if (compiler.hooks) {
148+
compiler.hooks.afterEmit.tapAsync(plugin, afterEmitFn);
149+
} else {
150+
compiler.plugin("after-emit", afterEmitFn);
151+
}
152152
}
153153

154-
const doneFn = () => {
155-
if (this.options.onBuildExit.length > 0) {
154+
if (this.options.onBuildExit.length > 0) {
155+
const doneFn = () => {
156156
this.execute(this.options.onBuildExit);
157157

158158
if (this.options.dev) {
159159
this.options.onBuildExit = [];
160160
}
161-
}
162-
};
161+
};
163162

164-
if (compiler.hooks) {
165-
// Information: `asyncTap` in future major
166-
compiler.hooks.done.tap(plugin, doneFn);
167-
} else {
168-
compiler.plugin("done", doneFn);
163+
if (compiler.hooks) {
164+
// Information: `asyncTap` in future major
165+
compiler.hooks.done.tap(plugin, doneFn);
166+
} else {
167+
compiler.plugin("done", doneFn);
168+
}
169169
}
170170
}
171171
}

0 commit comments

Comments
 (0)