File tree Expand file tree Collapse file tree 3 files changed +38
-1
lines changed
test/integration/app-dir-export Expand file tree Collapse file tree 3 files changed +38
-1
lines changed Original file line number Diff line number Diff line change @@ -372,7 +372,7 @@ export default async function getBaseWebpackConfig(
372372
373373 const babelConfigFile = getBabelConfigFile ( dir )
374374
375- if ( hasCustomExportOutput ( config ) ) {
375+ if ( ! dev && hasCustomExportOutput ( config ) ) {
376376 config . distDir = '.next'
377377 }
378378 const distDir = path . join ( dir , config . distDir )
Original file line number Diff line number Diff line change 11/** @type {import('next').NextConfig } */
22const nextConfig = {
33 output : 'export' ,
4+ // distDir: '.next-custom',
45 trailingSlash : true ,
56 generateBuildId ( ) {
67 return 'test-build-id'
Original file line number Diff line number Diff line change 1+ /* eslint-env jest */
2+
3+ import { join } from 'path'
4+ import fs from 'fs-extra'
5+ import {
6+ fetchViaHTTP ,
7+ File ,
8+ findPort ,
9+ killApp ,
10+ launchApp ,
11+ } from 'next-test-utils'
12+
13+ const appDir = join ( __dirname , '..' )
14+ const distDir = join ( appDir , '.next-custom' )
15+ const nextConfig = new File ( join ( appDir , 'next.config.js' ) )
16+ let app
17+ let appPort
18+
19+ describe ( 'app dir - with output export and custom distDir (next dev)' , ( ) => {
20+ beforeAll ( async ( ) => {
21+ nextConfig . replace ( '// distDir' , 'distDir' )
22+ appPort = await findPort ( )
23+ app = await launchApp ( appDir , appPort )
24+ } )
25+ afterAll ( async ( ) => {
26+ nextConfig . restore ( )
27+ await fs . remove ( distDir )
28+ await killApp ( app )
29+ } )
30+
31+ it ( 'should render properly' , async ( ) => {
32+ const res = await fetchViaHTTP ( appPort , '/' )
33+ expect ( res . status ) . toBe ( 200 )
34+ expect ( await res . text ( ) ) . toContain ( 'Home' )
35+ } )
36+ } )
You can’t perform that action at this time.
0 commit comments