PlasmoHQ / plasmo

🧩 The Browser Extension Framework
https://www.plasmo.com
MIT License
8.84k stars 315 forks source link

feat: add post-build hook #992

Closed oelmekki closed 4 weeks ago

oelmekki commented 1 month ago

Details

Allow to configure a hook to be ran whenever a build is made, so that users can perform post-build tasks. This is especially useful for the dev task, as a build is ran each time the filetree changes.

This is an opportunity for users to perform custom tasks that they may need on every builds. To do so, they just have to declare a POST_BUILD_SCRIPT environment variable containing the path to a script, like this:

POST_BUILD_SCRIPT=./post-build.cjs plasmo dev

The provided script must export a function, which will be executed:

module.exports = function() {
  // do stuff after build is done
}

Code of Conduct