From 198eb17820f94b6da366a93cfdca5dcb3d6253b1 Mon Sep 17 00:00:00 2001 From: JJ Kasper Date: Tue, 1 Oct 2019 19:35:42 +0200 Subject: [PATCH] Update to not copy static and public folders during auto export --- packages/next/export/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/next/export/index.js b/packages/next/export/index.js index f678dc00eca00..23d59697a8f89 100644 --- a/packages/next/export/index.js +++ b/packages/next/export/index.js @@ -139,7 +139,7 @@ export default async function (dir, options, configuration) { await mkdirp(join(outDir, '_next', buildId)) // Copy static directory - if (existsSync(join(dir, 'static'))) { + if (!options.buildExport && existsSync(join(dir, 'static'))) { log(' copying "static" directory') await recursiveCopy(join(dir, 'static'), join(outDir, 'static')) } @@ -226,6 +226,7 @@ export default async function (dir, options, configuration) { const publicDir = join(dir, CLIENT_PUBLIC_FILES_PATH) // Copy public directory if ( + !options.buildExport && nextConfig.experimental && nextConfig.experimental.publicDirectory && existsSync(publicDir)