Monday, January 23, 2017

JavaScript that works with both client side and server side

See the StackOverflow Article:
http://stackoverflow.com/questions/24685154/write-javascript-code-that-works-with-client-side-javascript-and-server-side-nod

http://stackoverflow.com/questions/27561252/how-to-correctly-include-lodash-underscore-on-website-with-conflicting-libs

Require.js Tutorial playlist:

https://www.youtube.com/watch?v=j588XXF4f2Y&list=PLYxzS__5yYQmDD-0A0Jvy27lUnrGIsq9o


Meh. I had this lodash script working in node, and now it does not want to work in the browser. Instead of the script src="". I'm trying require.js . It might help. Look at the load time of lodash verses example.js (my custom code) .

Edit: yes using require.js solves the issue and the file loads.


Requirejs doc:
http://requirejs.org/docs/start.html
http://requirejs.org/docs/api.html

Requirejs module YouTube:
https://www.youtube.com/watch?v=vWGuaZOTR4U

AMD (Asynchronous Module Definition) :
https://github.com/amdjs/amdjs-api/wiki/AMD



Also see in common with common.js and require.js : WebPack (https://webpack.github.io/docs/)

No comments:

Post a Comment