From c40ded0c12f4642b13123ba0e5d7170676ab850d Mon Sep 17 00:00:00 2001 From: Arunoda Susiripala Date: Sun, 14 May 2017 05:41:13 +0530 Subject: [PATCH] Copy the static directory for static file serving. --- server/export.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/server/export.js b/server/export.js index 150bbfbc..1fb99d24 100644 --- a/server/export.js +++ b/server/export.js @@ -35,6 +35,15 @@ export default async function (dir, options) { join(outDir, '_next', buildStats['app.js'].hash, 'app.js') ) + // Copy static directory + if (existsSync(join(dir, 'static'))) { + log(' copying "static" directory') + await cp( + join(dir, 'static'), + join(outDir, 'static') + ) + } + await copyPages(nextDir, outDir, buildId) // Get the exportPathMap from the `next.config.js`