From d015bac65f8eb8a3d6acf21ddcbd4e717dcf37fa Mon Sep 17 00:00:00 2001 From: Scott Polhemus Date: Wed, 7 Feb 2018 05:54:07 -0500 Subject: [PATCH] Copy static assets from .next folder when exporting (#3719) * Copy .next/static directory when exporting * Use nextDir --- server/export.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/server/export.js b/server/export.js index 92f0aa43..0a88fa1b 100644 --- a/server/export.js +++ b/server/export.js @@ -49,6 +49,15 @@ export default async function (dir, options, configuration) { ) } + // Copy .next/static directory + if (existsSync(join(nextDir, 'static'))) { + log(' copying "static build" directory') + await cp( + join(nextDir, 'static'), + join(outDir, '_next', 'static') + ) + } + // Copy dynamic import chunks if (existsSync(join(nextDir, 'chunks'))) { log(' copying dynamic import chunks')