Skip to content

Commit 7a236e9

Browse files
author
evilebottnawi
committed
chore: prepare 2.0.0 release
1 parent 8ac0838 commit 7a236e9

6 files changed

Lines changed: 309 additions & 211 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ 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+
## 2.0.0 - 2018-04-19
8+
9+
* Changed: remove `webpack@32` and `webpack@3` support.
10+
* Removed: `onBuildStart`, `onBuildEnd` and `onBuildExit` options. Use new events `onCompile`, `onAfterEmit` and `onDone` options.
11+
712
## 1.1.0 - 2018-04-18
813

914
* Feature: run `onBuildEnd` and `onBuildExit` in async mode for `webpack@4`.

README.md

Lines changed: 40 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const ExecaPlugin = require("execa-webpack-plugin");
2424
module.exports = {
2525
plugins: [
2626
new ExecaPlugin({
27-
onBuildStart: [
27+
onBeforeRun: [
2828
{
2929
args: ["build"],
3030
cmd: "del"
@@ -37,54 +37,49 @@ module.exports = {
3737

3838
## Options
3939

40-
| Name | Type | Default | Description |
41-
| :----------------: | :---------: | :---------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------- |
42-
| **`onBuildStart`** | `{Array}` | `[]` | Array of scripts to execute on the initial build. |
43-
| **`onBuildEnd`** | `{Array}` | `[]` | Array of scripts to execute after files are emitted at the end of the compilation. |
44-
| **`onBuildExit`** | `{Array}` | `[]` | array of scripts to execute after webpack's process is complete. |
45-
| **`bail`** | `{Boolean}` | `compiler.options.bail` | Report the first error as a hard error instead of tolerating it. |
46-
| **`dev`** | `{Boolean}` | `true` | Switch for development environments. This causes scripts to execute once. Useful for running HMR on webpack-dev-server or webpack watch mode. |
47-
| **`logLevel`** | `string` | `warn` | Enable logging. |
40+
| Name | Type | Default | Description |
41+
| :-------------------: | :---------: | :---------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------- |
42+
| **`on(NameOfEvent)`** | `{Array}` | `[]` | Array of scripts to execute on the event. | |
43+
| **`bail`** | `{Boolean}` | `compiler.options.bail` | Report the first error as a hard error instead of tolerating it. |
44+
| **`dev`** | `{Boolean}` | `true` | Switch for development environments. This causes scripts to execute once. Useful for running HMR on webpack-dev-server or webpack watch mode. |
45+
| **`logLevel`** | `string` | `warn` | Enable logging. |
4846

49-
### `onBuildStart`
47+
### `on(NameOfEvent)`
48+
49+
List of [events](https://webpack.js.org/api/compiler-hooks/).
50+
Name of event contain - `on` + event name (first character in upper case).
51+
Examples: `onBeforeRun`, `onRun`, `onWatchRun`, `onCompile` and etc.
5052

5153
```js
5254
[
5355
new ExecaPlugin({
54-
onBuildStart: [
56+
onBeforeRun: [
5557
{
5658
args: ["build"],
5759
cmd: "del"
5860
}
59-
]
60-
})
61-
];
62-
```
63-
64-
### `onBuildEnd`
65-
66-
```js
67-
[
68-
new ExecaPlugin({
69-
onBuildEnd: [
61+
],
62+
onCompile: [
7063
{
71-
args: ["trash"],
72-
cmd: "del"
64+
args: ["check"],
65+
cmd: "command"
7366
}
74-
]
75-
})
76-
];
77-
```
78-
79-
### `onBuildExit`
80-
81-
```js
82-
[
83-
new ExecaPlugin({
84-
onBuildExit: [
67+
],
68+
// Support nested command
69+
onDone: [
8570
{
86-
args: ["trash"],
87-
cmd: "del"
71+
args: [
72+
{
73+
args: ["arg"],
74+
cmd: "command-return-argument"
75+
},
76+
"other-argument",
77+
{
78+
args: ["arg"],
79+
cmd: "command-return-other-argument"
80+
}
81+
],
82+
cmd: "command"
8883
}
8984
]
9085
})
@@ -97,7 +92,7 @@ module.exports = {
9792
[
9893
new ExecaPlugin({
9994
bail: true,
100-
onBuildStart: [
95+
onBeforeRun: [
10196
{
10297
args: ["build"],
10398
cmd: "del"
@@ -109,11 +104,13 @@ module.exports = {
109104

110105
### `dev`
111106

107+
If you want to run command(s) in `watch` mode every time you can set `dev` option to false.
108+
112109
```js
113110
[
114111
new ExecaPlugin({
115-
dev: true,
116-
onBuildStart: [
112+
dev: false,
113+
onBeforeRun: [
117114
{
118115
args: ["build"],
119116
cmd: "del"
@@ -125,11 +122,13 @@ module.exports = {
125122

126123
### `logLevel`
127124

125+
Supports log [levels](https://github.com/webpack-contrib/webpack-log#level).
126+
128127
```js
129128
[
130129
new ExecaPlugin({
131130
logLevel: "info",
132-
onBuildStart: [
131+
onBeforeRun: [
133132
{
134133
args: ["build"],
135134
cmd: "del"

0 commit comments

Comments
 (0)