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

由于某些原因,我们需要 cdn 引入 omi, 请问怎么配置? #878

Open
ZhaoXH123 opened this issue Jun 25, 2024 · 1 comment
Open

Comments

@ZhaoXH123
Copy link

由于某些原因,我们需要 cdn 引入 omi, 请问怎么配置?

原因:我们使用 omi 做成一个个组件,每个组件都是独立的。 如果每个组件都包含omi 源码,组件会非常大,并且造成冗余。 我们想把 omi 使用 cdn 单独加载。一次性加载。 后面再加载各个组件。

我们尝试了各种方法, 比如:vite-plugin-cdn-import, 配置完成后, build, 发现各种的报错。

cdn 配置:
image

打包后:html 引入 cdn:
image

运行报错:
image

@Muna-Lombe
Copy link

Muna-Lombe commented Jun 25, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants