thingweb / node-wot

Web of Things implementation on Node.js
27 stars 13 forks source link

Add webpack bundle building to node-wot-td-tools #75

Closed huerlisi closed 6 years ago

huerlisi commented 6 years ago

The node-wot-td-tools package is useful not only in server scenarios using node, but also in browsers. To support usage in browsers, the classes need to be bundled, resolving the modules used in the sources.

This change introduces webpack to create a bundle file as part of the build process. You will find the resulting bundle in dist/node-wot-td-tools.bundle.js.

To use classes are available on the global NodeWotTdTools object.

huerlisi commented 6 years ago

One of the builds is passing, the other one is failing on Travis. When quickly parsing the build logs, I get the feeling that the failure is not due to my changes.

How to proceed here? Didn't find a way to re-trigger the build, idea?

huerlisi commented 6 years ago

Btw. I have follow-up patches to also add webpack bundling for more packages almost:-) The node-wot-protocol-http has some issues with the deasync package due to its use of the fs package that isn't available in browsers... Will talk to @mkovatsc tomorrow on how to resolve...

danielpeintner commented 6 years ago

I restarted the build with the same result. "Node.js: node" fails while "Node.js: node" build works just fine...

Need to look into it.. the commit doesn't really touch the 'node-wot-protocol-coap' test that fail

mkovatsc commented 6 years ago

Finally: https://github.com/eclipse/thingweb.node-wot/commit/944171819314090affdd57c2fbc1d2965941c169 Closing.