Skip to content
Permalink
Browse files

Ignore emacs lockfiles (#20497)

Fixes: #15278

> Bug report

> When using next dev with emacs, as you develop, emacs creates symbolic link files starting with .# as lock files. Next.js seems to attempt to load these but fails, spewing out errors constantly.

Prevents dev server from crashing when emacs creates lockfiles

tested with:

- GNU Emacs 27.1
- OSX 11.1
- Node v15.4.0
  • Loading branch information
lfender6445 committed Dec 29, 2020
1 parent 3140e40 commit f2f9090a50f42bb894fc7ea3db48e1b125ea85fa
Showing with 10 additions and 1 deletion.
  1. +1 −0 .gitignore
  2. +9 −1 packages/next/build/webpack-config.ts
@@ -25,6 +25,7 @@ test/**/next-env.d.ts

# Editors
**/.idea
**/.#*

# examples
examples/**/out
@@ -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

0 comments on commit f2f9090

Please sign in to comment.