V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
Shorekeeper
V2EX  ›  程序员

修改 React 中调用的 vime 使用的 CDN 地址

  •  
  •   Shorekeeper · May 29, 2022 · 1397 views
    This topic created in 1428 days ago, the information mentioned may be changed or developed.

    @vime/react会默认调用 jsdelivr 的资源文件,但在中国大陆不可及,有没有办法把它换成unpkg

    (调用的资源均为 npm 下,unpkg 一定有对应的资源)

    由于使用 webpack ,无法使用类似 https://github.com/PipecraftNet/jsdelivr-auto-fallback 这样的项目做 workaround

    4 replies    2022-05-29 22:40:32 +08:00
    mengyx
        1
    mengyx  
       May 29, 2022
    icon 图标是吧。之前处理过这个问题,我的解决方案是用 require 将图标打包进来。

    https://gist.github.com/ix64/88f9f9837ec4d6a40287667e9609f643
    Shorekeeper
        2
    Shorekeeper  
    OP
       May 29, 2022
    @mengyx 不仅有图标,还有`hls.js`
    mengyx
        3
    mengyx  
       May 29, 2022
    @SunsetShimmer #2 可以修改 https://vimejs.com/components/providers/hls HLS Provider 的 libSrc prop
    Shorekeeper
        4
    Shorekeeper  
    OP
       May 29, 2022
    @mengyx 多谢
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5546 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 01:31 · PVG 09:31 · LAX 18:31 · JFK 21:31
    ♥ Do have faith in what you're doing.