From 30f5ef7fb2793c8b050da0f1305528fcadae4ab1 Mon Sep 17 00:00:00 2001 From: chenbin92 Date: Tue, 15 Sep 2020 11:39:04 +0800 Subject: [PATCH] feat: pass parameters to run hook (#7) * feat: pass parameters to run hook * chore: version Co-authored-by: ClarkXia --- packages/build-scripts/CHANGELOG.md | 4 ++++ packages/build-scripts/package.json | 2 +- packages/build-scripts/src/commands/build.ts | 3 +-- packages/build-scripts/src/commands/start.ts | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/build-scripts/CHANGELOG.md b/packages/build-scripts/CHANGELOG.md index abd6976..7a20c03 100644 --- a/packages/build-scripts/CHANGELOG.md +++ b/packages/build-scripts/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 0.1.29 + +- [feat] add hook params + ## 0.1.28 - [feat] bump jest version diff --git a/packages/build-scripts/package.json b/packages/build-scripts/package.json index 065e7e0..26f4662 100644 --- a/packages/build-scripts/package.json +++ b/packages/build-scripts/package.json @@ -1,6 +1,6 @@ { "name": "@alib/build-scripts", - "version": "0.1.28", + "version": "0.1.29", "license": "MIT", "description": "scripts core", "main": "lib/index.js", diff --git a/packages/build-scripts/src/commands/build.ts b/packages/build-scripts/src/commands/build.ts index 84ca5cc..aec7e95 100644 --- a/packages/build-scripts/src/commands/build.ts +++ b/packages/build-scripts/src/commands/build.ts @@ -70,9 +70,8 @@ export = async function({ } }); - await applyHook(`before.${command}.run`); - const webpackConfig = configArr.map(v => v.chainConfig.toConfig()); + await applyHook(`before.${command}.run`, { args, config: webpackConfig }); let compiler: webpack.MultiCompiler; try { diff --git a/packages/build-scripts/src/commands/start.ts b/packages/build-scripts/src/commands/start.ts index 5b9ffd1..e642b6e 100644 --- a/packages/build-scripts/src/commands/start.ts +++ b/packages/build-scripts/src/commands/start.ts @@ -76,8 +76,8 @@ export = async function({ } } - await applyHook(`before.${command}.run`); const webpackConfig = configArr.map(v => v.chainConfig.toConfig()); + await applyHook(`before.${command}.run`, { args, config: webpackConfig }); let compiler; try {