Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change .web extension of document page to part of path #31116

Merged
merged 1 commit into from
Nov 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/next/build/entries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export function createPagesMapping(
// we alias these in development and allow webpack to
// allow falling back to the correct source file so
// that HMR can work properly when a file is added/removed
const documentPage = `_document${hasServerComponents ? '.web' : ''}`
const documentPage = `_document${hasServerComponents ? '-web' : ''}`
if (isDev) {
pages['/_app'] = `${PAGES_DIR_ALIAS}/_app`
pages['/_error'] = `${PAGES_DIR_ALIAS}/_error`
Expand Down
2 changes: 1 addition & 1 deletion packages/next/build/webpack-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ export default async function getBaseWebpackConfig(
prev.push(path.join(pagesDir, `_document.${ext}`))
return prev
}, [] as string[]),
`next/dist/pages/_document${hasServerComponents ? '.web' : ''}.js`,
`next/dist/pages/_document${hasServerComponents ? '-web' : ''}.js`,
]
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Default _document page for web runtime

import React from 'react'
import { Html, Head, Main, NextScript } from './_document'

Expand Down
2 changes: 1 addition & 1 deletion packages/next/taskfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -1123,7 +1123,7 @@ export async function pages_document(task, opts) {

export async function pages_document_server(task, opts) {
await task
.source('pages/_document.web.tsx')
.source('pages/_document-web.tsx')
.swc('client', { dev: opts.dev })
.target('dist/pages')
}
Expand Down