Enable tree shaking for leaflet
This commit is contained in:
parent
6fd43f3f08
commit
416a2963c3
@ -5,7 +5,8 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"serve": "vue-cli-service serve ",
|
"serve": "vue-cli-service serve ",
|
||||||
"build": "vue-cli-service build --report",
|
"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": {
|
"dependencies": {
|
||||||
"core-js": "^3.6.5",
|
"core-js": "^3.6.5",
|
||||||
|
11
scripts/fix-leaflet.mjs
Normal file
11
scripts/fix-leaflet.mjs
Normal file
@ -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));
|
Loading…
Reference in New Issue
Block a user