Skip to content

Commit a0e5eb1

Browse files
committed
Add output path for js_path
1 parent a9f1581 commit a0e5eb1

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

lib/elixir_script/manifest.ex

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,22 @@ defmodule ElixirScript.Manifest do
77
end
88

99
@spec write_manifest(binary, [{atom, map}], map) :: :ok
10-
def write_manifest(manifest_path, modules, _opts) do
10+
def write_manifest(manifest_path, modules, opts) do
11+
output_path = if opts.output == nil or opts.output == :stdout do
12+
""
13+
else
14+
Path.dirname(opts.output)
15+
end
16+
1117
data = Enum.reduce(modules, %{}, fn {module, info}, current_data ->
1218
info = %{
1319
references: info.used_modules,
1420
last_modified: info.last_modified,
1521
beam_path: Map.get(info, :beam_path),
1622
source: Map.get(info, :file),
17-
js_path: "Elixir.#{module}.js"
23+
js_path: Path.join(output_path, "#{module}.js")
1824
}
25+
1926
Map.put(current_data, module, info)
2027
end)
2128

0 commit comments

Comments
 (0)