I have been using requirejs on couple projects, and today is the first time I got this problem and not sure how to fix it. I am using requirejs and tyepscript, I can't really tell what's wrong here. Can someone take a look?
Here is my main.ts:
///<reference path="../lib/require/requirejs.d.ts"/>
///<reference path="TestClass.ts"/>
require.config(
{
baseUrl: 'js',
paths: {
puremvc: 'lib/puremvc/puremvc_standard_1.0_min'
}
}
);
require(
[
'puremvc',
'sim/TestClass'
],
function (TestClass ) {
var test = new TestClass();
test.logMsg("WHO AM I");
}
);
and this is my TestClass.ts
class TestClass{
constructor(){
console.log ("TestClass constructor")
}
public logMsg(msg:string){
console.log ("TestClass.log(): " + msg);
}
}
export = TestClass;
and my sim.html looks like this one
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Simulation Tester</title>
<script src="js/lib/puremvc/puremvc_standard_1.0_min.js"></script>
<script data-main="js/sim/main.js" src="js/lib/require/require.js" ></script>
</head>
<body >
</body>
</html>
And this is my folder structure:
- root
- sim.html
- js
- lib
- require (containt requirejs)
- sim
- main.ts
- TestClass.ts
Any idea?