Address PR feedback

This commit is contained in:
SleeplessOne1917 2023-06-29 06:18:31 -04:00
parent aaf9bc970c
commit c7ea1b7c56
6 changed files with 9 additions and 9 deletions

View file

@ -19,7 +19,7 @@ const [hostname, port] = process.env["LEMMY_UI_HOST"]
server.use(express.json()); server.use(express.json());
server.use(express.urlencoded({ extended: false })); server.use(express.urlencoded({ extended: false }));
server.use(`/static-${COMMIT_HASH}`, express.static(path.resolve("./dist"))); server.use(`/static/${COMMIT_HASH}`, express.static(path.resolve("./dist")));
server.use(setCacheControl); server.use(setCacheControl);
if (!process.env["LEMMY_UI_DISABLE_CSP"] && !process.env["LEMMY_UI_DEBUG"]) { if (!process.env["LEMMY_UI_DISABLE_CSP"] && !process.env["LEMMY_UI_DEBUG"]) {

View file

@ -88,7 +88,7 @@ export async function createSsrHtml(
<link rel="apple-touch-startup-image" href=${appleTouchIcon} /> <link rel="apple-touch-startup-image" href=${appleTouchIcon} />
<!-- Styles --> <!-- Styles -->
<link rel="stylesheet" type="text/css" href="/static-${COMMIT_HASH}/styles/styles.css" /> <link rel="stylesheet" type="text/css" href="/static/${COMMIT_HASH}/styles/styles.css" />
<!-- Current theme and more --> <!-- Current theme and more -->
${helmet.link.toString() || fallbackTheme} ${helmet.link.toString() || fallbackTheme}
@ -103,7 +103,7 @@ export async function createSsrHtml(
</noscript> </noscript>
<div id='root'>${root}</div> <div id='root'>${root}</div>
<script defer src='/static-${COMMIT_HASH}/js/client.js'></script> <script defer src='/static/${COMMIT_HASH}/js/client.js'></script>
</body> </body>
</html> </html>
`; `;

View file

@ -24,7 +24,7 @@ export class Icon extends Component<IconProps, any> {
})} })}
> >
<use <use
xlinkHref={`/static-${COMMIT_HASH}/assets/symbols.svg#icon-${this.props.icon}`} xlinkHref={`/static/${COMMIT_HASH}/assets/symbols.svg#icon-${this.props.icon}`}
></use> ></use>
<div className="visually-hidden"> <div className="visually-hidden">
<title>{this.props.icon}</title> <title>{this.props.icon}</title>

View file

@ -90,7 +90,7 @@ export class PersonListing extends Component<PersonListingProps, any> {
showAvatars() && ( showAvatars() && (
<PictrsImage <PictrsImage
src={ src={
avatar ?? `/static-${COMMIT_HASH}/assets/icons/icon-96x96.png` avatar ?? `/static/${COMMIT_HASH}/assets/icons/icon-96x96.png`
} }
icon icon
/> />

View file

@ -1,7 +1,7 @@
import { COMMIT_HASH } from "./version"; import { COMMIT_HASH } from "./version";
export const favIconUrl = `/static-${COMMIT_HASH}/assets/icons/favicon.svg`; export const favIconUrl = `/static/${COMMIT_HASH}/assets/icons/favicon.svg`;
export const favIconPngUrl = `/static-${COMMIT_HASH}/assets/icons/apple-touch-icon.png`; export const favIconPngUrl = `/static/${COMMIT_HASH}/assets/icons/apple-touch-icon.png`;
export const repoUrl = "https://github.com/LemmyNet"; export const repoUrl = "https://github.com/LemmyNet";
export const joinLemmyUrl = "https://join-lemmy.org"; export const joinLemmyUrl = "https://join-lemmy.org";

View file

@ -101,7 +101,7 @@ const createClientConfig = (_env, mode) => {
entry: "./src/client/index.tsx", entry: "./src/client/index.tsx",
output: { output: {
filename: "js/client.js", filename: "js/client.js",
publicPath: `/static-${commitHash}`, publicPath: `/static/${commitHash}`,
}, },
plugins: [ plugins: [
...base.plugins, ...base.plugins,
@ -109,7 +109,7 @@ const createClientConfig = (_env, mode) => {
enableInDevelopment: mode !== "development", // this may seem counterintuitive, but it is correct enableInDevelopment: mode !== "development", // this may seem counterintuitive, but it is correct
workbox: { workbox: {
modifyURLPrefix: { modifyURLPrefix: {
"/": `/static-${commitHash}/`, "/": `/static/${commitHash}/`,
}, },
cacheId: "lemmy", cacheId: "lemmy",
include: [/(assets|styles)\/.+\..+|client\.js$/g], include: [/(assets|styles)\/.+\..+|client\.js$/g],