Build app using cache offline
Current nw-builder always try to checkVersion .
Sometime , I've cached nw.js on local disk and I want to build nw app off line.
Could you supply 'off line mode' ?
same issue
@finscn
Hi,I've just solved the problem.
you just need a specific option,manifestUr for check version.
I created a versions.json file on my github blog for this
https://cssxn.github.io/versions.json
here's my build.js
var NwBuilder = require('nw-builder');
var nw = new NwBuilder({
appName:'wallet',
appVersion:'0.0.1',
files:'./www/**/**',
buildDir:'dist',
platforms:['osx64'],
downloadUrl:'https://cnpmjs.org/mirrors/nwjs/',
manifestUrl:'https://cssxn.github.io/versions.json',
version:'0.18.0'
});
// Log
nw.on('log',console.log);
// Build
nw.build().then(function(){
console.log('success');
}).catch(function(err){
console.log('CatchError',err);
});
One more thing The downloadUrl is not working! I don't know why.
but you can download what Version SDK you need before you run node build.js
The correct dir list
➜ myApp git:(master) ✗ ls cache
0.16.0-sdk 0.18.0-sdk 0.20.3-sdk
➜ myApp git:(master) ✗ ls cache/0.20.3-sdk
linux64 osx64 win64
@cssxn , thank you very much. Are you Chinese guy ?
@finscn yep! I have intended to answer it in Chinese, but for other guys need this! Though my English is poor
@finscn sure, but I'm not sure how that would work. Any ideas?
@cssxn cool but that won't work offline either?
One more thing The downloadUrl is not working! I don't know why.
The downloadUrl is used for legacy NW.js versions only I think.
If we verify SHA checksums on downloading NW.js (#593), then building app from cache offline should be no problem at all.
Closing this in favour of #623.
Resolved by #661