I am making a game in which I have a js class that I am exporting as follows:
var Game = cc.Class({
name: "WS",
});
module.exports = Game;
The above is in a file ws.js.
In the same directory as ws.js, I have a TypeScript file called transitions.ts where I try to import the Game module as follows:
import Game = require ("./Game");
I am getting an error: cannot find module './Game'
requirecalls -- Webpack, RollupJS, Node.js...require("./ws.js")if that's what the file is called, notGame.js?import Game = require ("./Game");looks weird, but it's valid in TypeScript.