Can't reload changed file when run snowpack in docker #1402
-
snowpack use chokidar to watch file. fs.watch can't work in docker.
set chokidar.watch option usePolling to true,chokidar will use fs.watchFile. chokidar.watch(Object.keys(config.mount), {
usePolling:true
}) should we add cli option to set usePolling to true? |
Beta Was this translation helpful? Give feedback.
Answered by
dj-nitehawk
Oct 28, 2020
Replies: 1 comment 3 replies
-
@baian1 thanks for the tip about chokidar. version: "3.8"
services:
web:
image: node:15-alpine
working_dir: /VisitorLog
ports:
- 8080:8080
restart: always
volumes:
- ${WEB_Source_Location}:/VisitorLog
environment:
- CHOKIDAR_USEPOLLING=true
command: npm start |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
baian1
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@baian1 thanks for the tip about chokidar.
i added an environment variable to enable chokidar polling in my docker compose and hmr works now. don't know if it's an efficient solution though.