-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix output: export with custom distDir (#62064)
This ensures we don't normalize the `distDir` in the webpack config in dev mode as it won't be moved to the right location like it is during build. Fixes: #61105 Closes NEXT-2495
- Loading branch information
Showing
3 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
test/integration/app-dir-export/test/dev-custom-dist-dir.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* eslint-env jest */ | ||
|
||
import { join } from 'path' | ||
import fs from 'fs-extra' | ||
import { | ||
fetchViaHTTP, | ||
File, | ||
findPort, | ||
killApp, | ||
launchApp, | ||
} from 'next-test-utils' | ||
|
||
const appDir = join(__dirname, '..') | ||
const distDir = join(appDir, '.next-custom') | ||
const nextConfig = new File(join(appDir, 'next.config.js')) | ||
let app | ||
let appPort | ||
|
||
describe('app dir - with output export and custom distDir (next dev)', () => { | ||
beforeAll(async () => { | ||
nextConfig.replace('// distDir', 'distDir') | ||
appPort = await findPort() | ||
app = await launchApp(appDir, appPort) | ||
}) | ||
afterAll(async () => { | ||
nextConfig.restore() | ||
await fs.remove(distDir) | ||
await killApp(app) | ||
}) | ||
|
||
it('should render properly', async () => { | ||
const res = await fetchViaHTTP(appPort, '/') | ||
expect(res.status).toBe(200) | ||
expect(await res.text()).toContain('Home') | ||
}) | ||
}) |