Merging GWT Generated Files

I am trying to create a JavaScript library from GWT. The big deal: I want to merge JavaScript files into one.

Basically, GWT generates two files:
[Your_Project] .nocache.js => Boot file
[MD5] .cache.html => The correct (?) JavaScript API.

index.html --- download ---> [Your_Project] .nocache.js ---- download ----> [MD5] .cache.html

I am trying to change this:
index.html --- download ---> all.js


But how to merge [Your_Project] .nocache.js and [MD5] .cache.html into one JavaScript file ...?

I’m not sure that it will be a difficult task.

Martin Magakyan

+1
source share
2 answers

It is possible, but only for one separate compilation. For example, the following compiles a single file for Firefox:

<set-property name="user.agent" value="gecko"/> <add-linker name="sso"/> 

Since GWT generates browser versions, this means that only one browser is supported in the compiled file. If you need other browsers, change user.agent and compile again. Please note that if you want to support multiple browsers, you need to provide the correct version to the user, something GWT does for you if you use the normal compilation process. So I'm not sure if this is what you really want.

+2
source

Use

 <collapse-all-properties /> <add-linker name="sso" /> 

in your ProjectName.gwt.xml file. Thus, all permutations are combined into a single JavaScript file.

+3
source

Source: https://habr.com/ru/post/1401105/


All Articles