Skip to content

Commit cfaa46a

Browse files
committed
chore: add github pages
1 parent b3f5c2b commit cfaa46a

File tree

11 files changed

+78
-43
lines changed

11 files changed

+78
-43
lines changed

.github/workflows/pages.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: github-pages
2+
3+
on: push
4+
5+
jobs:
6+
pages:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
11+
- name: Setup Node
12+
uses: actions/setup-node@v2.1.2
13+
with:
14+
node-version: '18.x'
15+
16+
- name: Cache .pnpm-store
17+
uses: actions/cache@v2
18+
with:
19+
path: ~/.pnpm-store
20+
key: ${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
21+
restore-keys: |
22+
${{ runner.os }}-${{ matrix.node-version }}
23+
24+
- name: install pnpm and npm
25+
run: |
26+
curl -L https://pnpm.js.org/pnpm.js | node - add --global pnpm@dev npm@6
27+
- name: pnpm install
28+
run: pnpm install
29+
- name: build pages
30+
run: pnpm run build:example
31+
32+
- name: GitHub Pages action
33+
uses: peaceiris/actions-gh-pages@v3
34+
with:
35+
github_token: ${{ secrets.GITHUB_TOKEN }}
36+
publish_dir: ./build
37+
cname: vueleaflet.brandonxiang.top

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ lerna-debug.log*
99

1010
node_modules
1111
dist
12+
build
1213
dist-ssr
1314
*.local
1415

cspell.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"version": "0.2",
3+
"ignorePaths": [],
4+
"dictionaryDefinitions": [],
5+
"dictionaries": [],
6+
"words": [
7+
"Tilelayer"
8+
],
9+
"ignoreWords": [],
10+
"import": []
11+
}

src/Layout.vue renamed to examples/Layout.vue

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
<script setup lang="ts">
2-
import LMap from './components/LMap.vue';
3-
import LTilelayer from './components/LTilelayer.vue';
4-
import LMarker from './components/LMarker.vue';
5-
import LTooltip from './components/LTooltip.vue';
6-
import LPopup from './components/LPopup.vue';
7-
import LCircle from './components/LCircle.vue';
8-
import LPolygon from './components/LPolygon.vue';
2+
import {
3+
LMap,
4+
LTilelayer,
5+
LMarker,
6+
LTooltip,
7+
LPopup,
8+
LCircle,
9+
LPolygon
10+
} from '../src';
911
import '../node_modules/leaflet/dist/leaflet.css';
1012
1113
</script>

examples/main.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { createApp } from 'vue'
2-
import App from '../dist/vueleaflet.es';
3-
import '../dist/style.css';
2+
import App from './Layout.vue';
43

54
createApp(App).mount('#app')

index.example.html

Lines changed: 0 additions & 13 deletions
This file was deleted.

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
</head>
99
<body>
1010
<div id="app"></div>
11-
<script type="module" src="/src/main.ts"></script>
11+
<script type="module" src="/examples/main.ts"></script>
1212
</body>
1313
</html>

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
}
1313
},
1414
"scripts": {
15-
"example": "vite dev --config vite.example.config.ts",
16-
"build": "vite build",
17-
"dev": "vite dev"
15+
"dev": "vite dev --config vite.example.config.ts",
16+
"build:example": "vite build --config vite.example.config.ts",
17+
"build": "vite build"
1818
},
1919
"dependencies": {
2020
"vue": "^3.3.4",

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
export { default as LMap } from './components/LMap.vue';
22
export { default as LMarker } from './components/LMarker.vue';
3-
export { default as LTooltip } from './components/LTooltip.vue';
3+
export { default as LTooltip } from './components/LTooltip.vue';
4+
export { default as LTilelayer} from './components/LTilelayer.vue';
45
export { default as LPopup } from './components/LPopup.vue';
56
export { default as LCircle } from './components/LCircle.vue';
67
export { default as LPolygon } from './components/LPolygon.vue';

src/main.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

vite.example.config.ts

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
import { defineConfig } from 'vite';
2-
import vue from '@vitejs/plugin-vue';
3-
import { resolve } from 'path';
1+
import { defineConfig } from "vite";
2+
import vue from "@vitejs/plugin-vue";
3+
import { resolve } from "path";
44

55
// https://vitejs.dev/config/
66
export default defineConfig({
7-
build: {
8-
rollupOptions: {
9-
input: {
10-
main: resolve(__dirname, 'index.example.html'),
11-
}
12-
}
13-
},
14-
plugins: [vue()],
15-
})
7+
build: {
8+
outDir: 'build',
9+
rollupOptions: {
10+
input: {
11+
main: resolve(__dirname, "index.html"),
12+
},
13+
},
14+
},
15+
plugins: [vue()],
16+
});

0 commit comments

Comments
 (0)