Skip to content

Commit 12780b1

Browse files
nasercaAlex Naserjosevalim
authored
Add project/0 warning (#14016)
Co-authored-by: Alex Naser <[email protected]> Co-authored-by: José Valim <[email protected]>
1 parent 8eba863 commit 12780b1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/mix/lib/mix/project.ex

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@ defmodule Mix.Project do
7575
the `:erlc_paths` configuration is used by `mix compile.erlang`, `mix compile.yecc`,
7676
and other tasks.
7777
78+
> #### Keep `project/0` fast {: .warning}
79+
>
80+
> `project/0` is called whenever your `mix.exs` is loaded, so heavy
81+
> computation should be avoided. If a task requires a potentially complex
82+
> configuration value, it should allow its configuration to be set to an
83+
> anonymous function or similar, so that it can be invoked only when
84+
> needed by the task itself.
85+
7886
## CLI configuration
7987
8088
Mix is most often invoked from the command line. For this purpose, you may define

0 commit comments

Comments
 (0)