From afd975151da32f3e51cb6f2afa0d2cef2f0f7214 Mon Sep 17 00:00:00 2001 From: atanasster Date: Sat, 6 Mar 2021 17:36:01 -0500 Subject: [PATCH] fix: nextjs plugin dist folder --- examples/starter/next.config.js | 1 - integrations/nextjs-plugin/src/build.ts | 7 ++++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/starter/next.config.js b/examples/starter/next.config.js index ce6c04aa9..67156884b 100644 --- a/examples/starter/next.config.js +++ b/examples/starter/next.config.js @@ -5,5 +5,4 @@ module.exports = withStories({ webpack5: true, }, configPath: '.config', - distDir: 'dist', }); diff --git a/integrations/nextjs-plugin/src/build.ts b/integrations/nextjs-plugin/src/build.ts index 219973868..75664effc 100644 --- a/integrations/nextjs-plugin/src/build.ts +++ b/integrations/nextjs-plugin/src/build.ts @@ -26,7 +26,7 @@ module.exports = ({ configPath, presets, staticFolder, - distFolder, + distFolder: userDistFolder, webpack, ...rest }: BuildProps) => () => { @@ -35,11 +35,12 @@ module.exports = ({ configPath, webpack, }; + const distFolder = userDistFolder || path.join(process.cwd(), 'public'); const buildConfig: BuildProps = { ...defaultCompileProps, ...{ - distFolder: distFolder || path.join(process.cwd(), 'public'), - staticFolder: staticFolder || path.join(process.cwd(), 'dist', 'static'), + distFolder, + staticFolder: staticFolder || path.join(distFolder, 'static'), }, ...userProps, };