File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,9 @@ import { PluginContext } from './build/plugin-context.js'
18
18
export const onPreBuild = async ( options : NetlifyPluginOptions ) => {
19
19
// Enable Next.js standalone mode at build time
20
20
process . env . NEXT_PRIVATE_STANDALONE = 'true'
21
- await restoreBuildCache ( new PluginContext ( options ) )
21
+ if ( ! options . constants . IS_LOCAL ) {
22
+ await restoreBuildCache ( new PluginContext ( options ) )
23
+ }
22
24
}
23
25
24
26
export const onBuild = async ( options : NetlifyPluginOptions ) => {
@@ -27,7 +29,11 @@ export const onBuild = async (options: NetlifyPluginOptions) => {
27
29
ctx . failBuild ( 'Publish directory not found, please check your netlify.toml' )
28
30
}
29
31
await setImageConfig ( ctx )
30
- await saveBuildCache ( ctx )
32
+
33
+ // only save the build cache if not run via the CLI
34
+ if ( ! options . constants . IS_LOCAL ) {
35
+ await saveBuildCache ( ctx )
36
+ }
31
37
32
38
await Promise . all ( [
33
39
copyStaticAssets ( ctx ) ,
You can’t perform that action at this time.
0 commit comments