Skip to content

Commit

Permalink
Add vite configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
francois2metz committed May 26, 2024
1 parent 90de38c commit 4a6df76
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,36 @@ const indoorequal = new IndoorEqual(map, { apiKey: 'myKey' });
indoorequal.loadSprite('/indoorequal');
```

**Usage with [vite](https://vitejs.dev/)**

Install the
[vite-plugin-static-copy](https://github.com/sapphi-red/vite-plugin-static-copy)
package and add to your vite config:

```javascript
import { viteStaticCopy } from 'vite-plugin-static-copy'

export default {
plugins: [
viteStaticCopy({
targets: [
{
src: 'node_modules/maplibre-gl-indoorequal/sprite,
dest: 'indoorequal'
}
]
})
]
}
```
Then load the sprite:
```javascript
const indoorequal = new IndoorEqual(map, { apiKey: 'myKey' });
indoorequal.loadSprite('/indoorequal');
```
## API
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
Expand Down

0 comments on commit 4a6df76

Please sign in to comment.