Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make runtime config optional #8

Closed
objectuser opened this issue Sep 21, 2021 · 2 comments
Closed

Make runtime config optional #8

objectuser opened this issue Sep 21, 2021 · 2 comments

Comments

@objectuser
Copy link
Contributor

We're doing the assets.deploy step using dart_sass in a Dockerfile and don't want the runtime.exs configuration to be required (DB config vars and the like).

Looking at esbuild, it has that as an option:

https://github.com/phoenixframework/esbuild/blob/d4cf71f62f6c01234f8ab2d39467f1cce8dbeee7/lib/mix/tasks/esbuild.ex#L34-L46

Wondering if that's viable for dart_sass? Something like:

  def run([profile | args] = all) do
    switches = [runtime_config: :boolean]
    {opts, remaining_args} = OptionParser.parse_head!(args, switches: switches)

    if opts[:runtime_config] do
      Mix.Task.run("app.config")
    else
      Application.ensure_all_started(:dart_sass)
    end

    case DartSass.install_and_run(String.to_atom(profile), remaining_args) do
      0 -> :ok
      status -> Mix.raise("`mix sass #{Enum.join(all, " ")}` exited with #{status}")
    end

    Mix.Task.reenable("sass")
  end

Thanks!

@mcrumm
Copy link
Member

mcrumm commented Sep 21, 2021

@objectuser Yes, definitely viable! A PR would be very welcome :)

@objectuser
Copy link
Contributor Author

@mcrumm Great, created #9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants