Commit 2f22fbf8 authored by Tim Neutkens's avatar Tim Neutkens

Replace comment with import() for webpack dynamic entries compat

parent ad5431b4
...@@ -6,7 +6,7 @@ import initWebpackHMR from './webpack-hot-middleware-client' ...@@ -6,7 +6,7 @@ import initWebpackHMR from './webpack-hot-middleware-client'
// https://github.com/zeit/next.js/issues/3775#issuecomment-407438123 // 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 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 // The runtimeChunk can't hot reload itself currently to correct it when adding pages using on-demand-entries
import('./noop') // REPLACE_NOOP_IMPORT
const { const {
__NEXT_DATA__: { __NEXT_DATA__: {
......
...@@ -37,7 +37,7 @@ try { ...@@ -37,7 +37,7 @@ try {
} }
// Workaround for noop.js loading // 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 // update file's data
file.data = Buffer.from(result.outputText.replace(/process\.env\.NEXT_VERSION/, `"${require('./package.json').version}"`), 'utf8') file.data = Buffer.from(result.outputText.replace(/process\.env\.NEXT_VERSION/, `"${require('./package.json').version}"`), 'utf8')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment