Skip to content

Conversation

@honwhy
Copy link
Contributor

@honwhy honwhy commented Mar 25, 2025

As mentioned earlier, CDN JS cannot be loaded from extension pages. For more details, please refer to this article.

cdn js无法在扩展中加载,需要做一次本地化处理,参考之前的文章
本次改动参考了vite plugin官方文档,https://cn.vite.dev/guide/api-plugin
调整本地化cdn js的vite plugin加载顺序,改用transformIndexHtml方案,确保在这些的插件执行后

  analytics: {
        id: `G-7NZL3PZ0NK`,
      },
    }),

才执行本地化cdn js的插件。

@github-actions
Copy link

github-actions bot commented Mar 25, 2025

😭 Deploy PR Preview failed.

@yanglbme yanglbme merged commit ecb9267 into doocs:main Mar 25, 2025
2 checks passed
@honwhy honwhy deleted the support-gtag-in-extension branch March 27, 2025 14:23
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

Successfully merging this pull request may close these issues.

2 participants