diff --git a/package.json b/package.json index 60688df..a5e8eba 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,8 @@ "scripts": { "serve": "vue-cli-service serve ", "build": "vue-cli-service build --report", - "lint": "vue-cli-service lint" + "lint": "vue-cli-service lint", + "postinstall": "node --experimental-modules --experimental-json-modules scripts/fix-leaflet.mjs" }, "dependencies": { "core-js": "^3.6.5", diff --git a/scripts/fix-leaflet.mjs b/scripts/fix-leaflet.mjs new file mode 100644 index 0000000..396a989 --- /dev/null +++ b/scripts/fix-leaflet.mjs @@ -0,0 +1,11 @@ +// @ts-check +import pkgJson from '../node_modules/leaflet/package.json'; + +import { writeFileSync } from 'fs'; + +writeFileSync( + './node_modules/leaflet/package.json', + JSON.stringify({ + ...pkgJson, + module: 'dist/leaflet-src.esm.js', + }, null, 2)); \ No newline at end of file