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:
|
with:
|
||||||
node-version: 16.x
|
node-version: 16.x
|
||||||
- run: cd js && npm install && npm run build
|
- 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
|
- name: build_app
|
||||||
uses: peaceiris/actions-gh-pages@v3
|
uses: peaceiris/actions-gh-pages@v3
|
||||||
if: ${{ github.ref == 'refs/heads/master' }}
|
if: ${{ github.ref == 'refs/heads/master' }}
|
||||||
|
|||||||
1
app/.gitignore
vendored
1
app/.gitignore
vendored
@@ -22,3 +22,4 @@ dist-ssr
|
|||||||
*.njsproj
|
*.njsproj
|
||||||
*.sln
|
*.sln
|
||||||
*.sw?
|
*.sw?
|
||||||
|
.env
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "tsc && vite build",
|
|
||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ const Header = styled("div", {
|
|||||||
height: "$4",
|
height: "$4",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const GIT_SHA = import.meta.env.VITE_GIT_SHA.substr(0,8)
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
globalStyles();
|
globalStyles();
|
||||||
|
|
||||||
@@ -27,7 +29,7 @@ function App() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Header>pmtiles viewer | github | toggle</Header>
|
<Header>pmtiles viewer | github | toggle | {GIT_SHA}</Header>
|
||||||
{file ? <MaplibreMap file={file} /> : <Start setFile={setFile} />}
|
{file ? <MaplibreMap file={file} /> : <Start setFile={setFile} />}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -2,6 +2,5 @@ import { defineConfig } from 'vite'
|
|||||||
import react from '@vitejs/plugin-react'
|
import react from '@vitejs/plugin-react'
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
base:'/PMTiles/',
|
|
||||||
plugins: [react()]
|
plugins: [react()]
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user