Help to execute javascript result of transpilar typescript

0

I have a javascript code result of transpilar code typescript .

Excerpt:

define("slider", ["require", "exports", "classes/Slider"], function (require, exports, Slider_1) {
    "use strict";
    exports.__esModule = true;

    function init() {
        // code
        // ...
    };
});

I try to access the previous code, but I do not know how to do it, for example, with one of the following statements in the same file and after the previous block:

init(); // Uncaught ReferenceError: init is not defined

console.log(Slider_1); // Uncaught ReferenceError: Slider_1 is not defined
  

Edited

I do not know if it's a problem with the code or with the generation of it. This is the tsconfig.json file located at the root of the project:

{
    "forceConsistentCasingInFileNames": true,
    "noImplicitReturns": true,
    "strict": true,
    "noUnusedLocals": true,
    "compilerOptions": {
        "module": "amd",
        "removeComments": true,
        "outFile": "./public/js/slider.js",
    },
    "include": [
        "./src/*",
        "./src/**/*",
    ],
}
    
asked by Orici 31.10.2018 в 00:25
source

0 answers