You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
代码入口没有引入 L 代表的 leaflet 包,导致使用 vite 打包 'vite build' 之后产生异常, undefine L.
现代前端项目通过 webpack 打包, 如果通过 vite build 打包前端文件,无法解析到 对 leaflet 的依赖关系.
改进方法
leaflet.extramarkers.js 文件
import * as L from 'leaflet'
The text was updated successfully, but these errors were encountered:
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
coryasilva
changed the title
需要显式引入 L 代表的 leaflet 包,否则会导致打包异常
Vite bundler support (需要显式引入 L 代表的 leaflet 包,否则会导致打包异常)
Sep 7, 2024
代码入口没有引入 L 代表的 leaflet 包,导致使用 vite 打包 'vite build' 之后产生异常, undefine L.
现代前端项目通过 webpack 打包, 如果通过 vite build 打包前端文件,无法解析到 对 leaflet 的依赖关系.
改进方法
leaflet.extramarkers.js 文件
import * as L from 'leaflet'
The text was updated successfully, but these errors were encountered: