Skip to content

Commit

Permalink
assets improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
essenciary committed Jun 10, 2022
1 parent f48e38a commit 3a66a3c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/StippleCharts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,27 @@ const COMPONENTS = [:apexchart => :VueApexCharts]

const assets_config = Genie.Assets.AssetsConfig(package = "StippleCharts.jl")

function deps() :: String
function deps() :: Vector{String}
if ! Genie.Assets.external_assets(Stipple.assets_config)

Genie.Router.route(Genie.Assets.asset_path(assets_config, :js, file="apexcharts.min")) do
Genie.Router.route(Genie.Assets.asset_route(assets_config, :js, file="apexcharts.min")) do
Genie.Renderer.WebRenderable(
Genie.Assets.embedded(Genie.Assets.asset_file(cwd=normpath(joinpath(@__DIR__, "..")), file="apexcharts.min.js")),
:javascript) |> Genie.Renderer.respond
end

Genie.Router.route(Genie.Assets.asset_path(assets_config, :js, file="vue-apexcharts.min")) do
Genie.Router.route(Genie.Assets.asset_route(assets_config, :js, file="vue-apexcharts.min")) do
Genie.Renderer.WebRenderable(
Genie.Assets.embedded(Genie.Assets.asset_file(cwd=normpath(joinpath(@__DIR__, "..")), file="vue-apexcharts.min.js")),
:javascript) |> Genie.Renderer.respond
end

end

string(
[
Genie.Renderer.Html.script(src="$(Genie.Assets.asset_path(assets_config, :js, file="apexcharts.min"))"),
Genie.Renderer.Html.script(src="$(Genie.Assets.asset_path(assets_config, :js, file="vue-apexcharts.min"))")
)
]
end

#===#
Expand All @@ -42,7 +42,7 @@ include("Charts.jl")
@reexport using .Charts

function __init__()
Stipple.DEPS[@__MODULE__] = deps
Stipple.deps!(@__MODULE__, deps)
end

end # module

0 comments on commit 3a66a3c

Please sign in to comment.