Skip to content

Commit

Permalink
Replace comment with import() for webpack dynamic entries compat
Browse files Browse the repository at this point in the history
  • Loading branch information
timneutkens committed Jan 11, 2019
1 parent ad5431b commit 2f22fbf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/next/client/next-dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import initWebpackHMR from './webpack-hot-middleware-client'
// https://github.com/zeit/next.js/issues/3775#issuecomment-407438123
// The runtimeChunk doesn't have dynamic import handling code when there hasn't been a dynamic import
// The runtimeChunk can't hot reload itself currently to correct it when adding pages using on-demand-entries
import('./noop')
// REPLACE_NOOP_IMPORT

const {
__NEXT_DATA__: {
Expand Down
2 changes: 1 addition & 1 deletion packages/next/taskfile-typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ try {
}

// Workaround for noop.js loading
if (file.base === 'next-dev.js') result.outputText = result.outputText.replace(/Promise\.resolve\(\)\.then\(\(\) => __importStar\(require\('\.\/noop'\)\)\);/, `import('./noop');`)
if (file.base === 'next-dev.js') result.outputText = result.outputText.replace('// REPLACE_NOOP_IMPORT', `import('./noop');`)

// update file's data
file.data = Buffer.from(result.outputText.replace(/process\.env\.NEXT_VERSION/, `"${require('./package.json').version}"`), 'utf8')
Expand Down

0 comments on commit 2f22fbf

Please sign in to comment.