Skip to content

Commit 42724ea

Browse files
authored
fix(build): fix build and types (#72)
fix build fix types add build to ci
1 parent 3e5ea9b commit 42724ea

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717
strategy:
1818
matrix:
19-
job: ['lint', 'format:check', 'type-check']
19+
job: ['lint', 'format:check', 'type-check', 'build']
2020

2121
steps:
2222
- name: Checkout repository

src/components/LSidepanel.vue

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,12 @@
4545
import * as L from 'leaflet';
4646
import 'leaflet.sidepanel';
4747
import 'leaflet.sidepanel/dist/style.css';
48-
import { onMounted, useSlots, ref, watch } from 'vue';
48+
import { onMounted, useSlots, ref, watch, type Slots } from 'vue';
4949
import LSidepanelTabNav from './LSidepanelTabNav.vue';
5050
5151
// Define Types
52-
type SidePanelPositionHeadings =
53-
| { key: string | number; value: string }[]
54-
| undefined;
52+
type SidePanelPositionHeading = { key: string | number; value: string };
53+
type SidePanelPositionHeadings = SidePanelPositionHeading[] | undefined;
5554
5655
// Define model
5756
const isOpen = defineModel<boolean>({ default: false, required: false });
@@ -100,7 +99,7 @@
10099
}>();
101100
102101
// use slots
103-
const slots = useSlots();
102+
const slots: Slots = useSlots();
104103
105104
// Initialize the side panel
106105
const map = ref<HTMLElement | null>(null);

vite.config.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,21 @@ export default defineConfig({
2828
fileName: (format) => `vue-leaflet-sidepanel.${format}.js`,
2929
},
3030
rollupOptions: {
31-
external: ['vue', 'leaflet', /^leaflet\/.*/, /^@vue-leaflet\/.*/],
31+
external: [
32+
'vue',
33+
'leaflet',
34+
/^leaflet\/.*/,
35+
/^@vue-leaflet\/.*/,
36+
'leaflet.sidepanel',
37+
'leaflet.sidepanel/dist/style.css', // Add this line
38+
],
3239
output: {
3340
// Global variables for use in the UMD build
3441
globals: {
3542
vue: 'Vue',
3643
leaflet: 'L',
3744
'@vue-leaflet/vue-leaflet': '@vue-leaflet/vue-leaflet',
45+
'leaflet.sidepanel': 'L.SidePanel',
3846
},
3947
},
4048
},

0 commit comments

Comments
 (0)