cazala / synaptic

architecture-free neural network library for node.js and the browser
http://caza.la/synaptic
Other
6.92k stars 665 forks source link

UMD Hot Tip #135

Open cdaringe opened 8 years ago

cdaringe commented 8 years ago

now that you're using webpack, if you weren't already aware, you don't need to manually do env detection. you can just specify to output a UMD bundle if you are compiling a dist bundle for folks

ref: https://webpack.github.io/docs/configuration.html#output-librarytarget

Jabher commented 8 years ago

Feel free to create a PR ;)

Actually I'm reworking the modular system, but I've discovered that UMD modules are exporting all of the exported properties into a global namespace, it's not the behavior we need in Synaptic - for us it's Layers, Architect, Network etc exported instead of one big Synaptic object. If you can fix it it would be great.

You can use my working branch - it already has some webpack updates. https://github.com/cazala/synaptic/blob/worker-based-es6/src/synaptic.js Still, the behavior is not very satisfying for now.