mirror of
https://github.com/protomaps/PMTiles.git
synced 2026-02-04 02:41:09 +00:00
vite configuration
This commit is contained in:
3
.github/workflows/actions.yml
vendored
3
.github/workflows/actions.yml
vendored
@@ -19,7 +19,8 @@ jobs:
|
||||
with:
|
||||
node-version: 16.x
|
||||
- run: cd js && npm install && npm run build
|
||||
- run: cd app && npm install && npm run build
|
||||
- run: echo "VITE_GIT_SHA=$(git rev-parse --short HEAD)" >> app/.env
|
||||
- run: cd app && npm install && ./node_modules/.bin/tsc && ./node_modules/.bin/vite build --base=/PMTiles/
|
||||
- name: build_app
|
||||
uses: peaceiris/actions-gh-pages@v3
|
||||
if: ${{ github.ref == 'refs/heads/master' }}
|
||||
|
||||
1
app/.gitignore
vendored
1
app/.gitignore
vendored
@@ -22,3 +22,4 @@ dist-ssr
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
.env
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
"version": "0.0.0",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "tsc && vite build",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
@@ -10,6 +10,8 @@ const Header = styled("div", {
|
||||
height: "$4",
|
||||
});
|
||||
|
||||
const GIT_SHA = import.meta.env.VITE_GIT_SHA.substr(0,8)
|
||||
|
||||
function App() {
|
||||
globalStyles();
|
||||
|
||||
@@ -27,7 +29,7 @@ function App() {
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Header>pmtiles viewer | github | toggle</Header>
|
||||
<Header>pmtiles viewer | github | toggle | {GIT_SHA}</Header>
|
||||
{file ? <MaplibreMap file={file} /> : <Start setFile={setFile} />}
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -2,6 +2,5 @@ import { defineConfig } from 'vite'
|
||||
import react from '@vitejs/plugin-react'
|
||||
|
||||
export default defineConfig({
|
||||
base:'/PMTiles/',
|
||||
plugins: [react()]
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user