Skip to content

Commit

Permalink
Produce CommonJS and UMD bundles (#932)
Browse files Browse the repository at this point in the history
  • Loading branch information
itsmichaeldiego committed Sep 1, 2020
1 parent 24b9c93 commit 9e06d20
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -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",
Expand Down
23 changes: 23 additions & 0 deletions 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;
10 changes: 10 additions & 0 deletions 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;

0 comments on commit 9e06d20

Please sign in to comment.