Skip to content

Commit a5b0b21

Browse files
committed
Merge branch 'main' into v4
2 parents 2387f71 + 97cd996 commit a5b0b21

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

demo/local-plugin/package-lock.json

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
const { join } = require('path')
44

5-
const { copy } = require('fs-extra')
5+
const { copy, existsSync } = require('fs-extra')
66

77
const { ODB_FUNCTION_NAME, HANDLER_FUNCTION_NAME } = require('./constants')
88
const { restoreCache, saveCache } = require('./helpers/cache')
@@ -51,9 +51,10 @@ module.exports = {
5151
setIncludedFiles({ netlifyConfig, publish })
5252

5353
await generateFunctions(constants, appDir)
54-
55-
await copy(`${appDir}/public`, `${publish}/`)
56-
54+
const publicDir = join(appDir, 'public')
55+
if (existsSync(publicDir)) {
56+
await copy(publicDir, `${publish}/`)
57+
}
5758
await setupImageFunction({ constants, imageconfig: images, netlifyConfig, basePath })
5859

5960
await generateRedirects({

0 commit comments

Comments
 (0)