jtulach/bck2brwsr

Is there any option to have a single Javascript file [QUESTION]

Closed this issue · 5 comments

Is there an option to merge bck2brwsr.js with the produced code into a single javascript file?

Yes, that is definitely possible. The default one .js per one .jar style was built upon the original transpiler that generated just a single .js file. If you control your compiler manually, then see this Javadoc - unless you specify Bck2Brwsr.library(true), you'll generate a self contained single .js file for all specified classes. As usual, the best is to see some tests. For example TestVM.java is using the compilation to single .js file.

Thank you very much for the directions, I will try this.

One more think to clear up; What happens to the following invokation code when we merge bck2brwsr.js with appclass.js into a single js file.

var vm = bck2brwsr('appclass.js');
var c = vm.loadClass('com.x.client.system.Task');
c.invoke('main');

I presume like this

var vm = bck2brwsr();
var c = vm.loadClass('com.x.client.system.Task');
c.invoke('main');

Is this correct?

Also from what I understand, there is no command line interface for the bck2brwsr. Basically, I have to write one myself, right?

Never mind javadoc explains it all. I was in rush. thanks.