You are developing a Node.js application, and you need to minify your JavaScript files every time before you build your project. Which lifecycle hook would you use to ensure that the minification script runs before the build script every time?

  • prebuild
  • prepublish
  • prestart
  • prerun
In a Node.js project, you would use the prepublish lifecycle hook to ensure that a script runs before the package is published. This hook is commonly used for tasks like minification before publishing to npm. The other options are not standard lifecycle hooks for this purpose.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *