react-starter-kit icon indicating copy to clipboard operation
react-starter-kit copied to clipboard

How to use externals to include external CDN based lib?

Open jma7889 opened this issue 11 years ago • 4 comments

It is not an issue, just don't know how to do it. No index.html or any html to edit, all js files. My question is if I want to load a vendor js lib from cloud, how to do I do that?

It would be easy to do that in a html file.

However, in js file, it only uses npm installed packages. How can I import the above lib with no html file? I tried import and require, they only work for local files.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

jma7889 avatar Oct 21 '15 03:10 jma7889

You should be able to add these external refs in src/components/Html/Html.js.

codeorelse avatar Oct 27 '15 12:10 codeorelse

Yes, it works now using Html.js

jma7889 avatar Oct 27 '15 12:10 jma7889

I know this is old, but what is the best way to do this? Ive got a cdn based version of jquery I need to bring in

Everything Ive tried to so far gives " ReferenceError: document is not defined"

ProtoJazz avatar Jan 23 '16 00:01 ProtoJazz

@jma7889 thank you very much for crating this issue! Unfortunately, we have close it due to inactivity. Feel free to re-open it or join our Discord channel for discussion.

NOTE: The main branch has been updated with React Starter Kit v2, using JAM-style architecture.

ulani avatar May 27 '21 19:05 ulani