diff --git a/.npmrc b/.npmrc index 1df2a6d..0dc62bb 100644 --- a/.npmrc +++ b/.npmrc @@ -1,2 +1,3 @@ registry=https://registry.npmjs.org/ package-lock=false +save-exact=true diff --git a/package.json b/package.json index 6703697..773eaff 100644 --- a/package.json +++ b/package.json @@ -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" } } diff --git a/packages/react-map-gl/esbuild.js b/packages/react-map-gl/esbuild.js new file mode 100644 index 0000000..d8ee53c --- /dev/null +++ b/packages/react-map-gl/esbuild.js @@ -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()], +}); diff --git a/packages/react-map-gl/package.json b/packages/react-map-gl/package.json new file mode 100644 index 0000000..1c79e5b --- /dev/null +++ b/packages/react-map-gl/package.json @@ -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" + ] + } +}