Skip to content

Commit

Permalink
Add project/0 warning (#14016)
Browse files Browse the repository at this point in the history
Co-authored-by: Alex Naser <[email protected]>
Co-authored-by: José Valim <[email protected]>
  • Loading branch information
3 people authored Nov 25, 2024
1 parent 8eba863 commit 12780b1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/mix/lib/mix/project.ex
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@ defmodule Mix.Project do
the `:erlc_paths` configuration is used by `mix compile.erlang`, `mix compile.yecc`,
and other tasks.
> #### Keep `project/0` fast {: .warning}
>
> `project/0` is called whenever your `mix.exs` is loaded, so heavy
> computation should be avoided. If a task requires a potentially complex
> configuration value, it should allow its configuration to be set to an
> anonymous function or similar, so that it can be invoked only when
> needed by the task itself.
## CLI configuration
Mix is most often invoked from the command line. For this purpose, you may define
Expand Down

0 comments on commit 12780b1

Please sign in to comment.