We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 58db060 commit 31484aaCopy full SHA for 31484aa
src/index.ts
@@ -52,6 +52,14 @@ export const onPostBuild = async (options: NetlifyPluginOptions) => {
52
await publishStaticDir(new PluginContext(options))
53
}
54
55
+export const onSuccess = async () => {
56
+ const prewarm = [process.env.DEPLOY_URL, process.env.DEPLOY_PRIME_URL, process.env.URL].filter(
57
+ // If running locally then the deploy ID is a placeholder value. Filtering for `https://0--` removes it.
58
+ (url?: string): url is string => Boolean(url && !url.startsWith('https://0--')),
59
+ )
60
+ await Promise.allSettled(prewarm.map((url) => fetch(url)))
61
+}
62
+
63
export const onEnd = async (options: NetlifyPluginOptions) => {
64
await unpublishStaticDir(new PluginContext(options))
65
0 commit comments