Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
shtyr-maxim committed Oct 25, 2023
1 parent 1263b8d commit 3254033
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,19 @@ For it to work, you need to declare two secrets in the GitHub Action:

- `APIKEY` - To run autotests on the JS API https://mappable.world/docs/js-api/quickstart.html#get-api-key
- `NPM_TOKEN` - To publish your package to npm

## Development loader

```js
// Add loader at the beginning of the loader queue
mappable.import.loaders.unshift(async (pkg) => {
// Process only this package
if (!pkg.includes('@mappable-world/mappable-web-mercator-projection')) return;

// Load script directly. You can use another CDN
await mappable.import.script(`/dist/index.js`);

// Return result object
return window['@mappable-world/mappable-web-mercator-projection'];
});
```
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ You can use some CDN with `mappable.import` JS API module loading handler on you
const {WebMercator} = await mappable.import('@mappable-world/mappable-web-mercator-projection');
```

**_NOTE:_**s
**_NOTE:_**
By default `mappable.import` can load self modules, scripts or style.
To make the code above work, you should add a loader:

Expand Down

0 comments on commit 3254033

Please sign in to comment.