diff --git a/.gitignore b/.gitignore index bc9176f4c40b9..f043ec68d93fb 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,7 @@ test/**/next-env.d.ts # Editors **/.idea +**/.#* # examples examples/**/out diff --git a/packages/next/build/webpack-config.ts b/packages/next/build/webpack-config.ts index 462d515903484..4b732e9681e7c 100644 --- a/packages/next/build/webpack-config.ts +++ b/packages/next/build/webpack-config.ts @@ -712,6 +712,8 @@ export default async function getBaseWebpackConfig( callback() } + const emacsLockfilePattern = '**/.#*' + let webpackConfig: webpack.Configuration = { externals: !isServer ? // make sure importing "next" is handled gracefully for client @@ -788,7 +790,13 @@ export default async function getBaseWebpackConfig( } }, watchOptions: { - ignored: ['**/.git/**', '**/node_modules/**', '**/.next/**'], + ignored: [ + '**/.git/**', + '**/node_modules/**', + '**/.next/**', + // can be removed after https://github.com/paulmillr/chokidar/issues/955 is released + emacsLockfilePattern, + ], }, output: { ...(isWebpack5