Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vite bundler support (需要显式引入 L 代表的 leaflet 包,否则会导致打包异常) #58

Open
zwq000 opened this issue Feb 27, 2021 · 1 comment
Labels

Comments

@zwq000
Copy link

zwq000 commented Feb 27, 2021

代码入口没有引入 L 代表的 leaflet 包,导致使用 vite 打包 'vite build' 之后产生异常, undefine L.
现代前端项目通过 webpack 打包, 如果通过 vite build 打包前端文件,无法解析到 对 leaflet 的依赖关系.
改进方法
leaflet.extramarkers.js 文件
import * as L from 'leaflet'

@coryasilva
Copy link
Owner

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

@coryasilva coryasilva changed the title 需要显式引入 L 代表的 leaflet 包,否则会导致打包异常 Vite bundler support (需要显式引入 L 代表的 leaflet 包,否则会导致打包异常) Sep 7, 2024
@coryasilva coryasilva added the bug label Sep 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants