JSFiddle - React, Tailwind, and code Playground

by Gerald Gillespie

HTML

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.14/require.js"></script>
  <title>JS Bin</title>
</head>
<body>


</body>
</html>

JavaScript

((require) => {
  require((H, DB) => {
    //your code goes here
    const myH = new H(DB);
    
		console.log(    myH.getPublic() );
    
    console.log(   myH.accessPrivateThroughPublic());
    try{
	    console.log(   myH.doPrivate());
    }catch(e){
    	console.log(e.message);
    }    

	console.log(Object.keys(myH))

  });

})( //myconfig loader goes here
  (() => {
    const myConfig = {

      config: (cfgObject, ...args) => {
        myConfig._ = {};
        const newPaths = {};
        if (cfgObject.paths) {
          for (let [name, path] of Object.entries(cfgObject.paths)) {
            let random = Math.floor(Math.random() * 10000);
            //        name = `${name}_${random}`;
            path = `${path}&random=${random}`;
            // console.log(path, name);

            newPaths[name] = path;
          }
          cfgObject.paths = newPaths;
        }
        this.modules = Object.keys(cfgObject.paths);
        require.config(cfgObject, ...args);

        myConfig.require = (fn) => {
          require(this.modules, fn)
        }
        return this;
      }
    };

    myConfig.config({
      paths: {
        'HL7Model': 'https://5490577-sb2.app.netsuite.com/core/media/media.nl?id=48395&c=5490577_SB2&h=jY01tqIvVfQjWniSY2nY4zx7TM2HSgiqszg1D5lQ58ep7jOW&_xt=.js',
        'DB': 'https://5490577-sb2.app.netsuite.com/core/media/media.nl?id=48396&c=5490577_SB2&h=x1z8kSt1oHdp4Wf5bDsUsEUXUZk24hanQHlUaVey-23xt_xw&_xt=.js'
      }
    });
    return myConfig.require;
  })(require)
)