cincheo/jsweet-examples

Multiple files problem

Closed this issue · 1 comments

I created two different Java classes in two different modules org.dziemian.ln.main.CanvasDrawing and org.dziemian.ln.view.LnNodeView. I use first Java class inside second, and jsweet generated js code for both. Inside CanvasDrawing.js there is such line generated:

var LnNodeView = org.dziemian.ln.view.LnNodeView;

The problem is, browser cannot execute this, because there is no information how to find LnNodeView.js file that is inside org/dziemian/ln/view/ directory. Insode CanvasDrawing.js there is no import or something similar to find LnNodeView.js

You need to execute the js file containing org.dziemian.ln.view.LnNodeView first (include it first in your HTML page).

There are several ways to solve this issue automatically (and once for all). For simplicity sake I would suggest to activate the JSweet "bundle" option. It will generate a unique JavaScript file containing all the js code placed in the right order.