Required js files returns undefined variables

I have the followings files:

MainView.ux:

<App>
	<JavaScript>

/* https://www.fusetools.com/docs/assets/bundle */

        var data = require('./test');
        console.log("value:" + data.value);

/* https://www.fusetools.com/docs/fusejs/bundle/read_bbef95e2 */

		var Bundle = require("FuseJS/Bundle");
		var contents = Bundle.readSync("test.js");
		console.log(contents);

	</JavaScript>
</App>

test.js:

var value = "test";

test.unoproj:

{
  "RootNamespace":"",
  "Packages": [
    "Fuse",
    "FuseJS"
  ],
  "Includes": [
    "*",
    "*.js:Bundle"
  ]
}

so why do I get:

LOG: value: undefined

LOG: var value = "test";

it seems that the file is not parsed as javascript

You need to assign it to module.exports:

test.js

var value = "test";

module.exports = {
    value: value
};