diff --git a/cli/plasmo/src/features/manifest-factory/base.ts b/cli/plasmo/src/features/manifest-factory/base.ts index abc2390f7..a6b7cde3b 100644 --- a/cli/plasmo/src/features/manifest-factory/base.ts +++ b/cli/plasmo/src/features/manifest-factory/base.ts @@ -224,6 +224,19 @@ export abstract class PlasmoManifest { } }) ) + + if (!process.env.POST_BUILD_SCRIPT) + return + + const postBuildPath = resolve(process.env.POST_BUILD_SCRIPT) + + if (!existsSync(postBuildPath)) { + console.error("Post-build file does not exist or is not readable:", postBuildPath) + return + } + + const postBuild = require(postBuildPath) + postBuild() } async updateEnv() {