Skip to content

Commit

Permalink
Update to ncc dev overlay during build instead of pre-compile (#34813)
Browse files Browse the repository at this point in the history
* Update to ncc dev overlay during build instead of pre-compile

* update config
  • Loading branch information
ijjk committed Feb 25, 2022
1 parent 0ec57da commit e6f14fa
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 15 deletions.
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

0 comments on commit e6f14fa

Please sign in to comment.