Quantcast
Channel: exports is not defined in Typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 2

exports is not defined in Typescript

$
0
0

I add JQuery in Typescript but I have this error:

Uncaught ReferenceError: exports is not defined

Code TS:

import * as $ from 'jquery'  $('.test').click(function(eventObject){      alert('med');  })  

code js:

"use strict"; exports.__esModule = true;var $ = require("jquery");$('.test').click(function (eventObject) {    alert('med');});

tsconfig.json:

{"compilerOptions": {"target": "es5","module": "es6","pretty": true,"experimentalDecorators":true    },"files": ["demo.ts","typings/index.d.ts"    ],"excluse": ["node_modules"]}

how to resolve this bug ?


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images