Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Possible to Disable CodeReloader in Phoenix?

The CodeReloader (in dev mode) is using Mix.Config. This fails when using distillery releases in dev_mode because mix is not available in releases.

Is it possible to completely disable CodeReloader in a Phoenix app, such that my app will not fail to start in a dev_mode release?

like image 974
Tony Pitale Avatar asked Oct 15 '25 12:10

Tony Pitale


1 Answers

In your applications /config/dev.exs you will have something along the lines of

config :my_app_web, MyApp.Web.Endpoint,
  http: [port: 4000],
  debug_errors: true,
  code_reloader: true,
  check_origin: false,
  watchers: [node: ["node_modules/brunch/bin/brunch", "watch", "--stdin",
                    cd: Path.expand("../assets", __DIR__)]]

Just change code_reloader: true to code_reloader: false. Or you could remove the following code from your MyApp.Endpoint

if code_reloading? do
  socket "/phoenix/live_reload/socket", Phoenix.LiveReloader.Socket
  plug Phoenix.LiveReloader
  plug Phoenix.CodeReloader
end
like image 84
Justin Wood Avatar answered Oct 17 '25 12:10

Justin Wood



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!