Closed andrewn closed 6 years ago
If we change this line, would we be able to mount the es.js
at /weboscket
?
Good idea, we can map es.js
as /websocket
.
In shared/websocket/package.json
we could set "main": "umd.js"
so that in node.js you will still require('websocket');
I'm proposing we use Rollup to bundle our shared WebSocket code for the browser and node.js. We've avoided this so far but it results in some limitations:
createWebsocket
function namecreateWebsocket
functionshared/websocket
code must all be in a single filenode.js
script
tagES Module
The above would also be usable within a module:
The only sad thing is
/websocket/es.js
. I think we could have/websocket/es
if we get express to serve it but it will have to be a different URL.