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
}
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:
The provided script must export a function, which will be executed:
Code of Conduct