From 4ffc51ad54e0646d09039f24593f6d3a56e6828f Mon Sep 17 00:00:00 2001 From: Caleb Kniffen Date: Wed, 12 Apr 2023 18:57:48 -0500 Subject: [PATCH] docs: detail how to reference on a cdn (#2271) --- README.md | 1 + UNIQUE_SETUPS.md | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index f1bd07483b..48ab5f7804 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,7 @@ It goes through: If you're using xrpl.js with React or Deno, you'll need to do a couple extra steps to set it up: +- [Using xrpl.js with a CDN](./UNIQUE_SETUPS.md#using-xrpljs-from-a-cdn) - [Using xrpl.js with `create-react-app`](./UNIQUE_SETUPS.md#using-xrpljs-with-create-react-app) - [Using xrpl.js with `React Native`](./UNIQUE_SETUPS.md#using-xrpljs-with-react-native) - [Using xrpl.js with `Vite React`](./UNIQUE_SETUPS.md#using-xrpljs-with-vite-react) diff --git a/UNIQUE_SETUPS.md b/UNIQUE_SETUPS.md index acc971f78b..60abb238c0 100644 --- a/UNIQUE_SETUPS.md +++ b/UNIQUE_SETUPS.md @@ -2,6 +2,15 @@ For when you need to do more than just install `xrpl.js` for it to work (especially for React projects in the browser). +### Using xrpl.js from a CDN + +You can avoid setting up your build system to handle `xrpl.js` by using a cdn version that is prebuilt for the browser. + +- unpkg `` +- jsdelivr `` + +Ensure that the full path is provided so the browser can find the sourcemaps. + ### Using xrpl.js with `create-react-app` To use `xrpl.js` with React, you need to install shims for core NodeJS modules. Starting with version 5, Webpack stopped including shims by default, so you must modify your Webpack configuration to add the shims you need. Either you can eject your config and modify it, or you can use a library such as `react-app-rewired`. The example below uses `react-app-rewired`.