小编The*_*The的帖子

如何在phoenix中配置重新编译

我正在使用 phoenix 创建服务器并使用编辑器 VSCode。

当我启动 server:mix phx.server并且我更改了代码时,它不会重新编译,我必须关闭并再次运行。

应该在可以自动重新编译的地方设置扩展或配置吗?

文件dev.exs

config :jwtuser, Jwtuser.Endpoint,
  http: [port: 5000],
  debug_errors: true,
  code_reloader: true,
  check_origin: false,
  watchers: [node: ["node_modules/brunch/bin/brunch", "watch", "--stdin",
                    cd: Path.expand("../assets", __DIR__)]]
Run Code Online (Sandbox Code Playgroud)

mix.exs 中

def project do
    [
      app: :jwtuser,
      version: "0.0.1",
      elixir: "~> 1.4",
      elixirc_paths: elixirc_paths(Mix.env),
      compilers: [:phoenix, :gettext] ++ Mix.compilers,
      start_permanent: Mix.env == :prod,
      aliases: aliases(),
      deps: deps(),
      erlc_options: erlc_options()
    ]
  end
Run Code Online (Sandbox Code Playgroud)

elixir-mix elixir phoenix-framework

1
推荐指数
1
解决办法
1115
查看次数

标签 统计

elixir ×1

elixir-mix ×1

phoenix-framework ×1