Skip to content

Commit 7bad200

Browse files
committed
Enable purging in Phoenix code server
1 parent e375acc commit 7bad200

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

lib/phoenix/code_reloader/server.ex

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,15 @@ defmodule Phoenix.CodeReloader.Server do
330330
# assets in priv are copied to the build directory.
331331
Mix.Project.build_structure(config)
332332

333-
# TODO: The purge option may no longer be required from Elixir v1.18
334-
args = ["--purge-consolidation-path-if-stale", consolidation_path | compile_args]
333+
args = [
334+
# TODO: The purge option may no longer be required from Elixir v1.18
335+
"--purge-consolidation-path-if-stale",
336+
consolidation_path,
337+
# Since Elixir v1.20, Elixir no longer automatically purges compiler
338+
# modules, which is ok for most workflows, but since code reloading never
339+
# shuts down the server, we enable purging to avoid too many temp modules.
340+
"--purge-compiler-modules" | compile_args
341+
]
335342

336343
{status, diagnostics} =
337344
with_logger_app(config, fn ->

0 commit comments

Comments
 (0)