Skip to content

Commit

Permalink
add react-map-gl (#352)
Browse files Browse the repository at this point in the history
* add react-map-gl

* mark react, react-dom, mapbox-gl as external

* Set up eik import mapping of React

* Save exact version

---------

Co-authored-by: Kjetil Sletten <[email protected]>
Co-authored-by: William Killerud <[email protected]>
  • Loading branch information
3 people authored Oct 21, 2024
1 parent ca8f729 commit cf32e80
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
registry=https://registry.npmjs.org/
package-lock=false
save-exact=true
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,16 @@
"packages/lit-html",
"packages/podium-browser",
"packages/lit-labs-ssr-client",
"packages/react-map-gl",
"packages/turf",
"packages/maplibre-gl"
],
"devDependencies": {
"@eik/cli": "3.1.10",
"@eik/esbuild-plugin": "1.1.48",
"browserslist": "4.24.0",
"browserslist-to-esbuild": "2.1.1",
"esbuild": "0.24.0",
"semver": "7.6.3"
}
}
14 changes: 14 additions & 0 deletions packages/react-map-gl/esbuild.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { createRequire } from "module";
import * as eik from "@eik/esbuild-plugin";
import { build } from "../../esbuild.js";

const { resolve } = createRequire(import.meta.url);

await eik.load();

await build({
entryPoints: [resolve("react-map-gl")],
outfile: "./dist/index.js",
external: ["mapbox-gl"],
plugins: [eik.plugin()],
});
26 changes: 26 additions & 0 deletions packages/react-map-gl/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "@finn-no/react-map-gl",
"version": "0.0.0",
"description": "An ESM version of react-map-gl for NMP",
"type": "module",
"scripts": {
"copy": "echo 'noop';",
"build": "node ./esbuild.js",
"eik:login": "eik login",
"eik:publish": "eik publish",
"eik:alias": "eik npm-alias",
"eik:publish:ci": "../../scripts/publish.js react-map-gl react-map-gl"
},
"dependencies": {
"react-map-gl": "7.1.7"
},
"eik": {
"name": "react-map-gl",
"server": "https://assets.finn.no",
"type": "npm",
"files": "dist",
"import-map": [
"https://assets.finn.no/map/react/v18"
]
}
}

0 comments on commit cf32e80

Please sign in to comment.