Skip to content

Commit 9e06d20

Browse files
Produce CommonJS and UMD bundles (google-map-react#932)
1 parent 24b9c93 commit 9e06d20

File tree

3 files changed

+35
-2
lines changed

3 files changed

+35
-2
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
"node": ">=10"
1616
},
1717
"scripts": {
18-
"build": "microbundle-crl --no-compress --format modern,cjs",
19-
"start": "microbundle-crl watch --no-compress --format modern,cjs",
18+
"build": "microbundle-crl -f cjs,umd src/index.cjs.js && microbundle-crl -f es,modern src/index.js",
19+
"start": "microbundle-crl watch -f cjs,umd",
2020
"prepare": "run-s build",
2121
"test": "run-s test:unit test:lint test:build",
2222
"test:build": "run-s build",

src/index.cjs.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import GoogleMap from './google_map';
2+
3+
import {
4+
convertNeSwToNwSe,
5+
convertNwSeToNeSw,
6+
fitBounds,
7+
meters2ScreenPixels,
8+
tile2LatLng,
9+
latLng2Tile,
10+
getTilesIds,
11+
} from './lib';
12+
13+
Object.assign(GoogleMap, {
14+
convertNeSwToNwSe,
15+
convertNwSeToNeSw,
16+
fitBounds,
17+
meters2ScreenPixels,
18+
tile2LatLng,
19+
latLng2Tile,
20+
getTilesIds,
21+
});
22+
23+
export default GoogleMap;

src/index.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
11
import GoogleMap from './google_map';
22

3+
export {
4+
convertNeSwToNwSe,
5+
convertNwSeToNeSw,
6+
fitBounds,
7+
meters2ScreenPixels,
8+
tile2LatLng,
9+
latLng2Tile,
10+
getTilesIds,
11+
} from './lib';
12+
313
export default GoogleMap;

0 commit comments

Comments
 (0)