Open APinchofDill opened 4 years ago
npm
scripts supports pre and post hooks. They are automatically run by npm before (pre) and after (post) their respectively script/command. But cli-ui
does not use npm/yarn command to execute script. All of the hooks are invalid. @sodatea Can we just use npm/yarn to execute the command? like this:
execa(<npm/yarn>, ['run', <task.name>], {...})
Yeah, if it does not break existing use cases, we can make that change.
Version
4.3.1
Reproduction link
https://github.com/dylanharty/vue-issue-pre
Environment info
Steps to reproduce
vue ui
(start interface)What is expected?
Upon triggering a "serve" or "build" tasks any task labelled preserve/prebuild respectively should trigger.
What is actually happening?
preserve
/prebuild
tasks do not trigger.A script in our app is required to run before each serve/build to generate some data before webpack starts for the application. The bug is that they do not run at all from the UI. yarn serve/yarn build works fine.
Maybe in a future release have the preserve and prebuild tasks live under serve and build tasks and toggle them.