Using Nuxt.JS, while on development with npm run dev
, I want to trigger the command npm run prettier
automatically when saving, to keep the code clean.
In any other project, I would achieve this with Nodemon with the following nodemon.json:
{
"events": {
"restart": "npm run prettify"
}
}
However Nuxt.JS doesn't seem to use Nodemon and/or it does not expose any "on change" event either.
How can I run a custom script when Nuxt.JS reloads?
Note: Looking for a solution not dependent on VSCode.