build: customize base url via PUBLIC_PATH environment variable

This commit is contained in:
kunish 2023-08-27 17:00:43 +08:00
parent b9ab6a9244
commit a92f18fd19
No known key found for this signature in database
GPG Key ID: 647A12B4F782C430
5 changed files with 9 additions and 8 deletions

View File

@ -21,6 +21,8 @@ jobs:
node-version: latest
- name: build
env:
PUBLIC_PATH: /metacubexd
run: |
pnpm install
pnpm build

View File

@ -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 />

View File

@ -2,9 +2,3 @@
@tailwind components;
@tailwind utilities;
@tailwind variants;
.app {
min-height: 100vh;
padding: 1rem;
@apply subpixel-antialiased;
}

View File

@ -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')

View File

@ -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',