Assets path, re-add async, fix z

This commit is contained in:
Liam 2024-04-29 20:13:54 -04:00
parent 7b4a047d90
commit f32190bde9
6 changed files with 12 additions and 12 deletions

View file

@ -28,7 +28,7 @@
"eslint-plugin-jest-dom": "^5.4.0",
"jest": "^29.7.0",
"jest-fetch-mock": "^3.0.3",
"ts-jest": "^29.1.2z"
"ts-jest": "^29.1.2"
}
},
"node_modules/@adobe/css-tools": {

View file

@ -33,6 +33,6 @@
"eslint-plugin-jest-dom": "^5.4.0",
"jest": "^29.7.0",
"jest-fetch-mock": "^3.0.3",
"ts-jest": "^29.1.2z"
"ts-jest": "^29.1.2"
}
}

View file

@ -51,9 +51,9 @@ export default defineConfig(({ command }: ConfigEnv): UserConfig => {
...Object.fromEntries(themes)
},
output: {
entryFileNames: 'assets/[name].js',
entryFileNames: '[name].js',
chunkFileNames: '[name].js',
assetFileNames: 'assets/[name][extname]'
assetFileNames: '[name][extname]'
}
}
},

View file

@ -19,7 +19,7 @@ html lang="en"
meta name="theme-color" content="#618fc3"
meta name="format-detection" content="telephone=no"
= csrf_meta_tag()
script type="module" src=Routes.static_path(@conn, "/assets/js/app.js")
script type="module" src=Routes.static_path(@conn, "/js/app.js") async="async"
= render PhilomenaWeb.LayoutView, "_opengraph.html", assigns
body data-theme=theme_name(@current_user)
= render PhilomenaWeb.LayoutView, "_burger.html", assigns

View file

@ -65,16 +65,16 @@ defmodule PhilomenaWeb.LayoutView do
end
def stylesheet_path(conn, %{theme: "dark"}),
do: Routes.static_path(conn, "/assets/css/dark.css")
do: Routes.static_path(conn, "/css/dark.css")
def stylesheet_path(conn, %{theme: "red"}),
do: Routes.static_path(conn, "/assets/css/red.css")
do: Routes.static_path(conn, "/css/red.css")
def stylesheet_path(conn, _user),
do: Routes.static_path(conn, "/assets/css/default.css")
do: Routes.static_path(conn, "/css/default.css")
def dark_stylesheet_path(conn),
do: Routes.static_path(conn, "/assets/css/dark.css")
do: Routes.static_path(conn, "/css/dark.css")
def theme_name(%{theme: theme}), do: theme
def theme_name(_user), do: "default"

View file

@ -6,10 +6,10 @@ defmodule PhilomenaWeb.SettingView do
[
key: "Default",
value: "default",
data: [theme_path: Routes.static_path(conn, "/assets/css/default.css")]
data: [theme_path: Routes.static_path(conn, "/css/default.css")]
],
[key: "Dark", value: "dark", data: [theme_path: Routes.static_path(conn, "/assets/css/dark.css")]],
[key: "Red", value: "red", data: [theme_path: Routes.static_path(conn, "/assets/css/red.css")]]
[key: "Dark", value: "dark", data: [theme_path: Routes.static_path(conn, "/css/dark.css")]],
[key: "Red", value: "red", data: [theme_path: Routes.static_path(conn, "/css/red.css")]]
]
end