Skip to content

Commit

Permalink
build: Fix frontend build
Browse files Browse the repository at this point in the history
Signed-off-by: Snorre Magnus Davøen <[email protected]>
  • Loading branch information
snorremd committed Oct 15, 2023
1 parent 5236e12 commit b7f8de8
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions .env.local
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_API_HOST=http://localhost:3000
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
name: Build Vite frontend for production with bun runtime
env:
## This is the URL the Solid app will use to make API calls
VITE_API_URL: https://norsky.snorre.io
VITE_API_HOST: https://norsky.snorre.io
run: bun run build


Expand Down
4 changes: 2 additions & 2 deletions frontend/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import 'chartjs-adapter-date-fns';
import icon from "../assets/favicon.png";

// Get the URL from the import.meta object
const url = import.meta.env.BASE_URL;
const host = import.meta.env.VITE_API_HOST;

const mapData = (data: any) => {
const mapped = data?.map(({ time, count }: any) => ({ x: time, y: count })).slice(data.length - 24, data.length)?? []
Expand Down Expand Up @@ -121,7 +121,7 @@ const PostPerHour: Component<{ lang: string, label: string }> = ({ lang, label }
// Create a new resource signal to fetch data from the API
// That is createResource('http://localhost:3000/dashboard/posts-per-hour');
const [data] = createResource(
`http://localhost:3000/dashboard/posts-per-hour?lang=${lang}`,
`${host}/dashboard/posts-per-hour?lang=${lang}`,
fetcher
);
return (
Expand Down
2 changes: 1 addition & 1 deletion postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
purge: ['./index.html', './src/**/*.{vue,js,ts,jsx,tsx}'],
purge: ['./index.html', './frontend/**/*.{vue,js,ts,jsx,tsx}'],
plugins: {
tailwindcss: {},
autoprefixer: {},
Expand Down
2 changes: 1 addition & 1 deletion tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { Config } from 'tailwindcss';
const config: Config = {
content: [
'./index.html',
'./src/**/*.{js,ts,jsx,tsx,css,md,mdx,html,json,scss}',
'./frontend/**/*.{js,ts,jsx,tsx,css,md,mdx,html,json,scss}',
],
darkMode: 'class',
theme: {
Expand Down

0 comments on commit b7f8de8

Please sign in to comment.