Skip to content

Commit

Permalink
build: customize base url via PUBLIC_PATH environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
kunish committed Aug 27, 2023
1 parent b9ab6a9 commit a92f18f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/publish-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
node-version: latest

- name: build
env:
PUBLIC_PATH: /metacubexd
run: |
pnpm install
pnpm build
Expand Down
5 changes: 4 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ export const App = () => {
})

return (
<div class="app relative" data-theme={curTheme()}>
<div
class="relative min-h-screen p-4 subpixel-antialiased"
data-theme={curTheme()}
>
<div class="sticky inset-x-0 top-0 z-50 flex items-center rounded-md bg-base-200 px-4 py-2">
<Show when={location.pathname !== '/setup'}>
<Header />
Expand Down
6 changes: 0 additions & 6 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,3 @@
@tailwind components;
@tailwind utilities;
@tailwind variants;

.app {
min-height: 100vh;
padding: 1rem;
@apply subpixel-antialiased;
}
3 changes: 2 additions & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import '~/index.css'

/* @refresh reload */
import 'solid-devtools'
import { render } from 'solid-js/web'

import { Router, hashIntegration } from '@solidjs/router'
import { App } from './App'
import './index.css'

const root = document.getElementById('root')

Expand Down
1 change: 1 addition & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { defineConfig } from 'vite'
import solidPlugin from 'vite-plugin-solid'

export default defineConfig({
base: process.env.PUBLIC_PATH || '/',
resolve: {
alias: {
'~': '/src',
Expand Down

0 comments on commit a92f18f

Please sign in to comment.