diff --git a/package.json b/package.json index 6fc7ec1..e9d88ee 100644 --- a/package.json +++ b/package.json @@ -15,8 +15,8 @@ "node": ">=10" }, "scripts": { - "build": "microbundle-crl --no-compress --format modern,cjs", - "start": "microbundle-crl watch --no-compress --format modern,cjs", + "build": "microbundle-crl -f cjs,umd src/index.cjs.js && microbundle-crl -f es,modern src/index.js", + "start": "microbundle-crl watch -f cjs,umd", "prepare": "run-s build", "test": "run-s test:unit test:lint test:build", "test:build": "run-s build", diff --git a/src/index.cjs.js b/src/index.cjs.js new file mode 100644 index 0000000..bfaca5a --- /dev/null +++ b/src/index.cjs.js @@ -0,0 +1,23 @@ +import GoogleMap from './google_map'; + +import { + convertNeSwToNwSe, + convertNwSeToNeSw, + fitBounds, + meters2ScreenPixels, + tile2LatLng, + latLng2Tile, + getTilesIds, +} from './lib'; + +Object.assign(GoogleMap, { + convertNeSwToNwSe, + convertNwSeToNeSw, + fitBounds, + meters2ScreenPixels, + tile2LatLng, + latLng2Tile, + getTilesIds, +}); + +export default GoogleMap; diff --git a/src/index.js b/src/index.js index ba33127..0b090aa 100644 --- a/src/index.js +++ b/src/index.js @@ -1,3 +1,13 @@ import GoogleMap from './google_map'; +export { + convertNeSwToNwSe, + convertNwSeToNeSw, + fitBounds, + meters2ScreenPixels, + tile2LatLng, + latLng2Tile, + getTilesIds, +} from './lib'; + export default GoogleMap;