From f083b46cc425fdf22b8c2685f0b5932360eb3c98 Mon Sep 17 00:00:00 2001 From: Mitchell Hanberg Date: Tue, 13 Jun 2023 21:29:01 -0400 Subject: [PATCH] fix: always preload modules --- example/config/config.exs | 3 +-- example/lib/templates.ex | 1 - lib/mix/tasks/tableau.build.ex | 2 +- lib/mix/tasks/tableau.server.ex | 2 ++ 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/example/config/config.exs b/example/config/config.exs index 6377aac..c1ca53a 100644 --- a/example/config/config.exs +++ b/example/config/config.exs @@ -2,14 +2,13 @@ import Config config :tableau, :reloader, patterns: [ - ~r"lib/.*.ex", + ~r"lib/.*.ex" ] config :temple, engine: EEx.SmartEngine, attributes: {Temple, :attributes} - config :tailwind, version: "3.0.24", default: [ diff --git a/example/lib/templates.ex b/example/lib/templates.ex index 0c2e8f1..6f3cb28 100644 --- a/example/lib/templates.ex +++ b/example/lib/templates.ex @@ -56,7 +56,6 @@ defmodule TabDemo.RootLayout do body do render(@inner_content) - c(&Tableau.Components.live_reload/1) end end diff --git a/lib/mix/tasks/tableau.build.ex b/lib/mix/tasks/tableau.build.ex index 9048899..2f8005c 100644 --- a/lib/mix/tasks/tableau.build.ex +++ b/lib/mix/tasks/tableau.build.ex @@ -8,7 +8,7 @@ defmodule Mix.Tasks.Tableau.Build do @impl Mix.Task def run(argv) do - Mix.Task.run("app.start") + Mix.Task.run("app.start", ["--preload-modules"]) {opts, _argv} = OptionParser.parse!(argv, strict: [out: :string]) diff --git a/lib/mix/tasks/tableau.server.ex b/lib/mix/tasks/tableau.server.ex index 9667a69..02f75d4 100644 --- a/lib/mix/tasks/tableau.server.ex +++ b/lib/mix/tasks/tableau.server.ex @@ -12,6 +12,8 @@ defmodule Mix.Tasks.Tableau.Server do Logger.debug("server started on http://localhost:4999") + Mix.Task.run("app.start", ["--preload-modules"]) + Mix.Tasks.Run.run(["--no-halt"]) end end