Skip to content

Commit 0ca8b83

Browse files
jingsamQingWei-Li
authored andcommitted
fix: fix livereload deprecation warning (#38)
Since livereload v0.6.3, we get the warning: ``` $ docsify serve ./docs --open *** DEPRECATION WARNING *** The exts option will REPLACE extensions in 0.6.4. *** ``` As the author of livereload [commented](napcs/node-livereload#94 (comment)): in the next version, the exts option will REPLACE all the default extensions with only what you specify. That means `exts: ['md']` will only watch markdown files. If we want to also watch default extensions, we should use `extraExts: ['md']`. This PR upgrade `livereload` and use `extraExts` option to fix the warning.
1 parent 855c58a commit 0ca8b83

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/commands/serve.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ module.exports = function (path, openInBrowser, port, livereloadPort) {
2828
server.use(serveStatic(path))
2929
server.listen(port)
3030
lrserver.createServer({
31-
exts: ['md'],
31+
extraExts: ['md'],
3232
exclusions: ['node_modules/'],
3333
port: livereloadPort
3434
}).watch(path)

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"docsify": ">=3",
3535
"docsify-server-renderer": ">=4",
3636
"fs-extra": "^2.1.2",
37-
"livereload": "^0.6.2",
37+
"livereload": "^0.7.0",
3838
"lru-cache": "^4.1.1",
3939
"open": "^0.0.5",
4040
"serve-static": "^1.12.1",

0 commit comments

Comments
 (0)