Skip to content

Commit

Permalink
Fix live_reload patterns
Browse files Browse the repository at this point in the history
Match the dot of the file extension and at least one basename character.
  • Loading branch information
azizk committed Jul 1, 2024
1 parent 4c10bab commit 49e7d9e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions installer/templates/phx_single/config/dev.exs
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ config :<%= @app_name %>, <%= @endpoint_module %>,
config :<%= @app_name %>, <%= @endpoint_module %>,
live_reload: [
patterns: [
~r"priv/static/(?!uploads/).*(js|css|png|jpeg|jpg|gif|svg)$",<%= if @gettext do %>
~r"priv/gettext/.*(po)$",<% end %>
~r"lib/<%= @lib_web_name %>/(controllers|live|components)/.*(ex|heex)$"
~r"priv/static/(?!uploads/).+\.(js|css|png|jpeg|jpg|gif|svg)$",<%= if @gettext do %>
~r"priv/gettext/.+\.(po)$",<% end %>
~r"lib/<%= @lib_web_name %>/(controllers|live|components)/.+\.(ex|heex)$"
]
]<% end %>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ config :<%= @web_app_name %>, <%= @endpoint_module %>,
config :<%= @web_app_name %>, <%= @endpoint_module %>,
live_reload: [
patterns: [
~r"priv/static/(?!uploads/).*(js|css|png|jpeg|jpg|gif|svg)$",<%= if @gettext do %>
~r"priv/gettext/.*(po)$",<% end %>
~r"lib/<%= @web_app_name %>/(controllers|live|components)/.*(ex|heex)$"
~r"priv/static/(?!uploads/).+\.(js|css|png|jpeg|jpg|gif|svg)$",<%= if @gettext do %>
~r"priv/gettext/.+\.(po)$",<% end %>
~r"lib/<%= @web_app_name %>/(controllers|live|components)/.+\.(ex|heex)$"
]
]<% end %>

Expand Down
6 changes: 3 additions & 3 deletions lib/phoenix/endpoint.ex
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@ defmodule Phoenix.Endpoint do
live_reload: [
url: "ws://localhost:4000",
patterns: [
~r"priv/static/(?!uploads/).*(js|css|png|jpeg|jpg|gif|svg)$",
~r"lib/app_web/(live|views)/.*(ex)$",
~r"lib/app_web/templates/.*(eex)$"
~r"priv/static/(?!uploads/).+\.(js|css|png|jpeg|jpg|gif|svg)$",
~r"lib/app_web/(live|views)/.+\.(ex)$",
~r"lib/app_web/templates/.+\.(eex)$"
]
]
Expand Down

0 comments on commit 49e7d9e

Please sign in to comment.