JQuery and NWJS Packaging
it seems like that you need to use libraries that require JQuery, such as bootstrap js or backnone.
if you just use standard html src
it might trigger an error saying that js is nto defined.
Solution is to include jquery using js and adding it to the dom, and use a callabck to add other library that need it as dependency once done.
Issue Jquery not loading in nwjs once is packaged for deployment and can’t figure out why.
For reproducing the issue,I boiled it down to a minimal repo
Download this repo [url coming soon]
npm start
you see "Added using jquery"
because in index.html
there is
if you do node deploy.js
you see "Default html text"
which is the html in index, which mean jquery did not substitute the text in main
if you look at the error in console in the packaged version
is the main error.
Earlier solution, was bit of callback hell to make sure the script are loaded in the right order.
--> UPDATE: Current solution as to 1.0.5
version is to use browserify to bundle the client side js together. This also ensures that they are loaded in the right order.
JQuery
jquery.min.1.12.4.js
seems to hit the sweet spot between being compatible with NWJS, Bootstrap, and having the .find()
that has been used in the client side and is not supported in previous versions.
Last updated