mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +00:00
Enable Hot Module Replacement in webpack.
This allow the webbpack dev server to properly reload JavaScript modules while running in dev without restarting the server. We need to connect to webpack-dev-server directly because SockJS doesn't support more than one connection on the same host/port.
This commit is contained in:
committed by
Tim Abbott
parent
0718eb5220
commit
d3ffc81726
@@ -187,6 +187,10 @@ else:
|
||||
webpack_cmd = ['./tools/webpack', '--watch', '--port', str(webpack_port)]
|
||||
if options.minify:
|
||||
webpack_cmd.append('--minify')
|
||||
if options.interface:
|
||||
webpack_cmd += ["--host", options.interface]
|
||||
else:
|
||||
webpack_cmd += ["--host", "0.0.0.0"]
|
||||
cmds.append(webpack_cmd)
|
||||
for cmd in cmds:
|
||||
subprocess.Popen(cmd)
|
||||
@@ -380,7 +384,6 @@ class Application(web.Application):
|
||||
(r"/json/events.*", TornadoHandler),
|
||||
(r"/api/v1/events.*", TornadoHandler),
|
||||
(r"/webpack.*", WebPackHandler),
|
||||
(r"/sockjs-node.*", WebPackHandler),
|
||||
(r"/sockjs.*", TornadoHandler),
|
||||
(r"/.*", DjangoHandler)
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user