My single-page dashboard is quite basic, as it just displays weather updates and subway alerts. I usually refresh it on my local machine, and the structure looked like this:
project/
index.html
jquery-3.3.1.min.js
script.js
I decided to switch it to TypeScript. I converted `script.js` to TypeScript but needed to download jQuery's definition file from here. Now, my project directory looks like this:
project/
index.html
jquery.d.ts
script.ts
The initial lines of my TypeScript file are:
/// <reference path ="./jquery.d.ts"/>
import * as $ from "jquery"
After running `tsc *.ts`, my script compiles successfully. However, the first few lines of the resulting JavaScript file are causing issues:
"use strict";
exports.__esModule = true;
/// <reference path ="./jquery.d.ts"/>
var $ = require("jquery");
This leads to an error in the browser stating:
exports.__esModule = true; // Can't find variable: exports
As someone who is not very experienced with front-end development beyond HTML/JS/jQuery, I'm a bit lost. I tried searching online for solutions but didn't find much useful information.