def METHOD_NAME(host: str, port: str, minify: bool, disable_host_check: bool) -> None:
    """watches and rebuilds on changes, serving files from memory via webpack-dev-server"""
    # This is our most dynamic configuration, which we use for our
    # dev server.  The key piece here is that we identify changes to
    # files as devs make edits and serve new assets on the fly.
    webpack_args = ["../node_modules/.bin/webpack-cli", "serve"]
    webpack_args += [
        # webpack-cli has a bug where it ignores --watch-poll with
        # multi-config, and we don't need the katex-cli part anyway.
        "--config-name=frontend",
        f"--host={host}",
        f"--port={port}",
        # We add the hot flag using the cli because it takes care
        # of addition to entry points and adding the plugin
        # automatically
        "--hot",
    ]
    if minify:
        webpack_args.append("--env=minimize")
    if disable_host_check:
        webpack_args.append("--allowed-hosts=all")
    else:
        webpack_args.append(f"--allowed-hosts={host},.zulipdev.com,.zulipdev.org")
    # Tell webpack-dev-server to fall back to periodic polling on
    # filesystems where inotify is known to be broken.
    cwd = os.getcwd()
    inotify_broken = False
    with open("/proc/self/mounts") as mounts:
        for line in mounts:
            fields = line.split()
            if fields[1] == cwd:
                inotify_broken = fields[2] in ["nfs", "vboxsf", "prl_fs"]
    if inotify_broken:
        os.environ["CHOKIDAR_USEPOLLING"] = "1"
        os.environ["CHOKIDAR_INTERVAL"] = "1000"
    # TODO: This process should also fall back to periodic polling if
    # inotify_broken.
    import pyinotify
    try:
        webpack_process = subprocess.Popen(webpack_args)
        class WebpackConfigFileChangeHandler(pyinotify.ProcessEvent):
            def process_default(self, event: pyinotify.Event) -> None:
                nonlocal webpack_process
                print("Restarting webpack-dev-server due to config changes...")
                webpack_process.terminate()
                webpack_process.wait()
                webpack_process = subprocess.Popen(webpack_args)
        watch_manager = pyinotify.WatchManager()
        event_notifier = pyinotify.Notifier(watch_manager, WebpackConfigFileChangeHandler())
        # We did a chdir to the root of the Zulip checkout above.
        for filepath in [
            "webpack.config.ts",
            "webpack.assets.json",
            "webpack.dev-assets.json",
        ]:
            watch_manager.add_watch(filepath, pyinotify.IN_MODIFY)
        event_notifier.loop()
    finally:
        webpack_process.terminate()
        webpack_process.wait()