diff --git a/.gitignore b/.gitignore index bc9176f4c40b93..4bf9d309cbcf19 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 d8bebe133b5ee4..1250af3cd1d9e5 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,12 @@ export default async function getBaseWebpackConfig( } }, watchOptions: { - ignored: ['**/.git/**', '**/node_modules/**', '**/.next/**'], + ignored: [ + '**/.git/**', + '**/node_modules/**', + '**/.next/**', + emacsLockfilePattern, + ], }, output: { ...(isWebpack5