Skip to content

Commit 9800b60

Browse files
committed
Add json_polyfill when required
1 parent 1586498 commit 9800b60

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

mix.exs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,15 @@ defmodule ImageLensCorrection.MixProject do
4343
# cannot be scoped to `:dev` here.
4444
{:sweet_xml, "~> 0.7"},
4545
{:ex_doc, "~> 0.34", only: [:dev], runtime: false}
46-
]
46+
] ++ maybe_json_polyfill()
47+
end
48+
49+
defp maybe_json_polyfill do
50+
if Code.ensure_loaded?(:json) do
51+
[]
52+
else
53+
[{:json_polyfill, "~> 0.2 or ~> 1.0"}]
54+
end
4755
end
4856

4957
defp package do

0 commit comments

Comments
 (0)