File tree Expand file tree Collapse file tree 2 files changed +15
-9
lines changed
Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Original file line number Diff line number Diff line change 1- import "phoenix_html" ;
2- import { Socket } from "phoenix" ;
31import topbar from "../vendor/topbar" ;
4- import { LiveSocket } from "phoenix_live_view" ;
52
63let socketPath =
74 document . querySelector ( "html" ) . getAttribute ( "phx-socket" ) || "/live" ;
@@ -228,7 +225,7 @@ let params = () => {
228225 } ;
229226} ;
230227
231- let liveSocket = new LiveSocket ( socketPath , Socket , {
228+ let liveSocket = new LiveView . LiveSocket ( socketPath , Phoenix . Socket , {
232229 params : params ,
233230 hooks : Hooks ,
234231 dom : {
Original file line number Diff line number Diff line change @@ -3,13 +3,22 @@ defmodule AshAdmin.Layouts do
33 use AshAdmin.Web , :html
44 use Phoenix.Component
55
6- js_path = Path . join ( __DIR__ , "../../../priv/static/assets/app.js" )
7- css_path = Path . join ( __DIR__ , "../../../priv/static/assets/app.css" )
6+ phoenix_js_paths =
7+ for app <- ~w( phoenix phoenix_html phoenix_live_view) a do
8+ path = Application . app_dir ( app , [ "priv" , "static" , "#{ app } .js" ] )
9+ Module . put_attribute ( __MODULE__ , :external_resource , path )
10+ path
11+ end
12+
13+ @ static_path Application . app_dir ( :ash_admin , [ "priv" , "static" ] )
814
9- @ external_resource js_path
10- @ external_resource css_path
15+ @ external_resource js_path = Path . join ( @ static_path , "assets/app.js" )
16+ @ external_resource css_path = Path . join ( @ static_path , "assets/app.css" )
1117
12- @ app_js File . read! ( js_path )
18+ @ app_js """
19+ #{ for path <- phoenix_js_paths , do: path |> File . read! ( ) |> String . replace ( "//# sourceMappingURL=" , "// " ) }
20+ #{ File . read! ( js_path ) }
21+ """
1322 @ app_css File . read! ( css_path )
1423
1524 def render ( "app.js" , _ ) , do: @ app_js
You can’t perform that action at this time.
0 commit comments