리눅스는 사용자당 inotify 감시 개수에 상한(max_user_watches)이 있다1 — 모자라면 webpack 이 변경을 못 알아챈다2.
# `System limit for number of file watchers reached`
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
Footnotes
-
inotify(7) - Linux manual page: “/proc/sys/fs/inotify/max_user_watches This specifies an upper limit on the number of watches that can be created per real user ID.” ↩
-
Watch and WatchOptions | webpack: “Verify that you have enough available watchers in your system. If this value is too low, the file watcher in Webpack won’t recognize the changes” ↩
webpack 은 .mjs 를 javascript/esm 으로 고정해 CommonJS 를 막는다1 — type 을 직접 주면 그 기본 규칙을 건너뛴다2.
configureWebpack: {
module: {
rules: [
{
test: /\.mjs$/,
include: /node_modules/,
type: 'javascript/auto',
},
],
},
},
Footnotes
-
Module Methods | webpack: “
.mjsor.jswith"type": "module"inpackage.json” → “No CommonJS allowed, for example, you can’t userequire,module.exportsorexports”. webpack 4 기본 규칙:{ test: /\.mjs$/i, type: "javascript/esm" }↩ -
Module | webpack: “
Rule.typesets the type for a matching module. This prevents defaultRules and their default importing behaviors from occurring.” ↩