Open zwq000 opened 3 years ago
Google translation
The code entry does not introduce the leaflet package represented by L, resulting in an exception after using vite package 'vite build', undefine L. Modern front-end projects are packaged through webpack. If the front-end files are packaged through vite build, the dependency on leaflet cannot be resolved. Improvement method
代码入口没有引入 L 代表的 leaflet 包,导致使用 vite 打包 'vite build' 之后产生异常, undefine L. 现代前端项目通过 webpack 打包, 如果通过 vite build 打包前端文件,无法解析到 对 leaflet 的依赖关系. 改进方法 leaflet.extramarkers.js 文件 import * as L from 'leaflet'