From 8f9cf048b26979e1eb4b65ff33c4eb8c76311755 Mon Sep 17 00:00:00 2001 From: Luke Fender Date: Sat, 26 Dec 2020 12:25:33 -0500 Subject: [PATCH] Ignore emacs lockfiles - also updates gitignore Fixes: https://github.com/vercel/next.js/issues/15278 --- .gitignore | 1 + packages/next/build/webpack-config.ts | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) 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