pleroma-like client for Bluesky pl.hexmani.ac
bluesky pleroma social-media

Fix static files not loading in production build

hexmani.ac 48ebeae3 47dc9eba

verified
Changed files
+24 -16
src
static
styles
+2 -2
index.html
···
</head>
<body id="root">
<noscript class="nojs">
-
<link rel="stylesheet" href="static/styles/nojs.css" />
<div class="container">
<div class="container-header">
<span>Bluroma</span>
···
has blocked Bluroma from using JavaScript. Please enable
JavaScript to continue.
</p>
-
<img src="static/favicon.png" alt="Bluroma logo" />
</div>
</noscript>
</body>
···
</head>
<body id="root">
<noscript class="nojs">
+
<link rel="stylesheet" href="/styles/nojs.css" />
<div class="container">
<div class="container-header">
<span>Bluroma</span>
···
has blocked Bluroma from using JavaScript. Please enable
JavaScript to continue.
</p>
+
<img src="/favicon.png" alt="Bluroma Logo" />
</div>
</noscript>
</body>
+2 -1
src/App.tsx
···
import "./App.scss";
import { Component } from "solid-js";
const App: Component = () => {
return (
<>
-
<img src="static/favicon.png" width="100" />
<h1>Bluroma</h1>
</>
);
···
import "./App.scss";
import { Component } from "solid-js";
+
import logo from "/favicon.png?url";
const App: Component = () => {
return (
<>
+
<img src={logo} width="100" />
<h1>Bluroma</h1>
</>
);
+14 -9
static/styles/nojs.css
···
background-color: rgba(15, 22, 30, 1);
border-radius: var(--radius);
margin: 1em;
-
padding-bottom: 1rem;
max-height: 100%;
max-width: 350px;
box-shadow:
0px 0px 3px 0px rgba(0, 0, 0, 0.5),
0px 4px 6px 3px rgba(0, 0, 0, 0.3);
}
.container-header {
-
font-weight: 500;
background-color: var(--foreground);
text-align: left;
padding: 1em;
height: 1rem;
border-radius: var(--radius) var(--radius) 0 0;
-
margin-bottom: 1em;
box-shadow:
0px 1px 3px 0px rgba(0, 0, 0, 0.4),
0px 1px 0px 0px rgba(255, 255, 255, 0.2) inset;
-
}
-
-
img {
-
margin-top: 0.5rem;
-
max-width: 50px;
-
filter: grayscale(1);
}
}
···
background-color: rgba(15, 22, 30, 1);
border-radius: var(--radius);
margin: 1em;
+
padding-bottom: 0.5rem;
max-height: 100%;
max-width: 350px;
box-shadow:
0px 0px 3px 0px rgba(0, 0, 0, 0.5),
0px 4px 6px 3px rgba(0, 0, 0, 0.3);
+
+
h2,
+
p {
+
padding: 0 1rem;
+
}
+
+
img {
+
height: 2.5rem;
+
filter: grayscale(1);
+
padding-bottom: 0.5rem;
+
}
}
.container-header {
+
font-weight: normal;
background-color: var(--foreground);
text-align: left;
padding: 1em;
height: 1rem;
border-radius: var(--radius) var(--radius) 0 0;
+
margin-bottom: 1rem;
box-shadow:
0px 1px 3px 0px rgba(0, 0, 0, 0.4),
0px 1px 0px 0px rgba(255, 255, 255, 0.2) inset;
}
}
+6 -4
vite.config.ts
···
-
import { defineConfig } from 'vite';
-
import solidPlugin from 'vite-plugin-solid';
-
import devtools from 'solid-devtools/vite';
export default defineConfig({
plugins: [devtools(), solidPlugin()],
server: {
port: 3000,
},
build: {
-
target: 'esnext',
},
});
···
+
import { defineConfig } from "vite";
+
import solidPlugin from "vite-plugin-solid";
+
import devtools from "solid-devtools/vite";
export default defineConfig({
plugins: [devtools(), solidPlugin()],
server: {
port: 3000,
},
+
root: "./",
build: {
+
target: "esnext",
},
+
publicDir: "static",
});