How do I load third party JavaScript from a CDN when using RequireJS?

前端 未结 1 675
闹比i
闹比i 2021-01-31 17:45

I\'ve been using RequireJS for dependency management and must say that I love it - JavaScript has really matured recently.

However, one thing I cannot figure out is this

1条回答
  •  遇见更好的自我
    2021-01-31 18:38

    This will load jQuery from a CDN:

    
    
    
    
    hello

    Fiddle Here.

    This page from the requirejs docs shows how to eliminate a path from the optimised build. Basically use the empty: scheme. Excerpt here:

    node ../../r.js -o name=main out=main-built.js baseUrl=. paths.jquery=empty:
    

    0 讨论(0)
提交回复
热议问题