nw-builder icon indicating copy to clipboard operation
nw-builder copied to clipboard

Build app using cache offline

Open finscn opened this issue 9 years ago • 6 comments

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' ?

finscn avatar Jan 09 '17 09:01 finscn

same issue

cssxn avatar Mar 03 '17 08:03 cssxn

@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 avatar Mar 03 '17 09:03 cssxn

@cssxn , thank you very much. Are you Chinese guy ?

finscn avatar Mar 03 '17 18:03 finscn

@finscn yep! I have intended to answer it in Chinese, but for other guys need this! Though my English is poor

cssxn avatar Mar 06 '17 01:03 cssxn

@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.

adam-lynch avatar May 16 '17 22:05 adam-lynch

If we verify SHA checksums on downloading NW.js (#593), then building app from cache offline should be no problem at all.

ayushmanchhabra avatar Jul 08 '22 04:07 ayushmanchhabra

Closing this in favour of #623.

ayushmanchhabra avatar Aug 14 '22 04:08 ayushmanchhabra

Resolved by #661

ayushmanchhabra avatar Oct 14 '22 03:10 ayushmanchhabra