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, };