mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-20 11:45:50 +00:00
Standardize imports to work in browser + node
This commit is contained in:
@@ -1,4 +1,9 @@
|
||||
const xrpl = require('xrpl')
|
||||
// Dependencies for Node.js.
|
||||
// In browsers, use <script> tags as in the example demo.html.
|
||||
if (typeof module !== "undefined") {
|
||||
// gotta use var here because const/let are block-scoped to the if statement.
|
||||
var xrpl = require('xrpl')
|
||||
}
|
||||
|
||||
async function main() {
|
||||
// Connect -------------------------------------------------------------------
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
const xrpl = require('xrpl')
|
||||
// Dependencies for Node.js.
|
||||
// In browsers, use <script> tags as in the example demo.html.
|
||||
if (typeof module !== "undefined") {
|
||||
// gotta use var here because const/let are block-scoped to the if statement.
|
||||
var xrpl = require('xrpl')
|
||||
}
|
||||
|
||||
async function main() {
|
||||
// Connect -------------------------------------------------------------------
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
const xrpl = require('xrpl')
|
||||
// Dependencies for Node.js.
|
||||
// In browsers, use <script> tags as in the example demo.html.
|
||||
if (typeof module !== "undefined") {
|
||||
// gotta use var here because const/let are block-scoped to the if statement.
|
||||
var xrpl = require('xrpl')
|
||||
}
|
||||
|
||||
async function main() {
|
||||
// Connect -------------------------------------------------------------------
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
const xrpl = require('xrpl')
|
||||
// Dependencies for Node.js.
|
||||
// In browsers, use <script> tags as in the example demo.html.
|
||||
if (typeof module !== "undefined") {
|
||||
// gotta use var here because const/let are block-scoped to the if statement.
|
||||
var xrpl = require('xrpl')
|
||||
}
|
||||
|
||||
async function main() {
|
||||
// Connect -------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user