Unverified Commit 590a3ade authored by Joe Haddad's avatar Joe Haddad Committed by GitHub

Only copy `public/` directory if enabled (#7988)

parent c6928dcf
...@@ -149,7 +149,11 @@ export default async function (dir, options, configuration) { ...@@ -149,7 +149,11 @@ export default async function (dir, options, configuration) {
const publicDir = join(dir, CLIENT_PUBLIC_FILES_PATH) const publicDir = join(dir, CLIENT_PUBLIC_FILES_PATH)
// Copy public directory // Copy public directory
if (existsSync(publicDir)) { if (
nextConfig.experimental &&
nextConfig.experimental.publicDirectory &&
existsSync(publicDir)
) {
log(' copying "public" directory') log(' copying "public" directory')
await recursiveCopy(publicDir, outDir, { await recursiveCopy(publicDir, outDir, {
filter (path) { filter (path) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment