Skip to content

Commit

Permalink
chore: externalize maplibre from build #35 (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
wazolab authored Nov 21, 2024
1 parent 500a67f commit 1e29b2d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"scripts": {
"dev": "vite",
"build": "vite build && tsc",
"build": "tsc && vite build",
"build:demo": "vite build --mode development",
"preview": "vite preview",
"preversion": "yarn build"
Expand Down
8 changes: 8 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ export default defineConfig(({ command, mode }) => {
name: 'MaplibreGlTeritorioCluster',
fileName: 'maplibre-gl-teritorio-cluster'
},
rollupOptions: {
external: ['maplibre-gl'], // Exclude maplibre-gl from the bundle
output: {
globals: {
'maplibre-gl': 'maplibregl', // Define the global variable for maplibre-gl in the browser
},
},
}
} : undefined
}
})

0 comments on commit 1e29b2d

Please sign in to comment.