[x3d-public] import fs as ‘fs’. Babel?

John Carlson yottzumm at gmail.com
Fri Mar 17 09:30:18 PDT 2023

Any help integrating XMLSerializer into index.mjs referenced by index.html
would be appreciated! It's perfectly fine if you start from scratch, but
make sure that the result code runs in the browser.  You might even try
leaving out the import altogether!

I am pretty sure the latest nodejs module is "@xmldom/xmldom".


I currently have:

$ cat index.mjs
import fs from 'fs';
import dom from "@xmldom/xmldom";

var ser = new dom.XMLSerializer();

On Thu, Mar 9, 2023 at 5:15 AM John Carlson <yottzumm at gmail.com> wrote:

> Here is a basic webpack/babel/express/https example for loading node.js
> .mjs files with
> import fs from "fs"
> into the client.
> Let me know if you get any errors.
> If anyone wants to create a tutorial (there are *way* too many options
> online) or otherwise copy over to X3DJSONLD, let me know.
> https://github.com/coderextreme/fstest
> This is up-to-date everything except nodejs, which is at: v18.13
> I'm hoping to progress with X3DJSONLD fairly soon.
> Thanks!
> On Thu, Feb 23, 2023 at 7:40 PM John Carlson <yottzumm at gmail.com> wrote:
>> Does anyone know how to use JavaScript server code on client?   I think
>> the answer is Babel.
>> Thanks!
>> John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20230317/67d3ae10/attachment.html>

More information about the x3d-public mailing list