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

Update to ncc dev overlay during build instead of pre-compile #34813

Merged
merged 2 commits into from Feb 25, 2022
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
7 changes: 0 additions & 7 deletions packages/next/compiled/@next/react-dev-overlay/client.js

This file was deleted.

Binary file not shown.

This file was deleted.

This file was deleted.

13 changes: 7 additions & 6 deletions packages/next/taskfile.js
Expand Up @@ -163,11 +163,12 @@ export async function ncc_next__react_dev_overlay(task, opts) {
)
)
.ncc({
precompiled: false,
packageName: '@next/react-dev-overlay',
externals: overlayExternals,
target: 'es5',
})
.target('compiled/@next/react-dev-overlay')
.target('dist/compiled/@next/react-dev-overlay')

await task
.source(
Expand All @@ -178,15 +179,16 @@ export async function ncc_next__react_dev_overlay(task, opts) {
)
)
.ncc({
precompiled: false,
packageName: '@next/react-dev-overlay',
externals: overlayExternals,
target: 'es5',
})
.target('compiled/@next/react-dev-overlay')
.target('dist/compiled/@next/react-dev-overlay')

const clientFile = join(
__dirname,
'compiled/@next/react-dev-overlay/client.js'
'dist/compiled/@next/react-dev-overlay/client.js'
)
const content = fs.readFileSync(clientFile, 'utf8')
// remove AMD define branch as this forces the module to not
Expand Down Expand Up @@ -266,7 +268,7 @@ export async function ncc_jest_worker(task, opts) {

// eslint-disable-next-line camelcase
export async function ncc_react_refresh_utils(task, opts) {
await fs.remove(join(__dirname, 'compiled/react-refresh'))
await fs.remove(join(__dirname, 'dist/compiled/react-refresh'))
await fs.copy(
dirname(require.resolve('react-refresh/package.json')),
join(__dirname, 'dist/compiled/react-refresh')
Expand Down Expand Up @@ -1711,7 +1713,6 @@ export async function ncc(task, opts) {
await task.serial(
[
'ncc_browserslist',
'ncc_next__react_dev_overlay',
'copy_regenerator_runtime',
'copy_babel_runtime',
'copy_constants_browserify',
Expand Down Expand Up @@ -1744,7 +1745,7 @@ export async function compile(task, opts) {
],
opts
)
await task.serial(['ncc_react_refresh_utils'])
await task.serial(['ncc_react_refresh_utils', 'ncc_next__react_dev_overlay'])
}

export async function bin(task, opts) {
Expand Down