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 d8bebe133b5ee..36862d579108e 100644 --- a/packages/next/build/webpack-config.ts +++ b/packages/next/build/webpack-config.ts @@ -706,6 +706,8 @@ export default async function getBaseWebpackConfig( callback() } + const emacsLockfilePattern = '**/.#*' + let webpackConfig: webpack.Configuration = { externals: !isServer ? // make sure importing "next" is handled gracefully for client @@ -782,7 +784,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