I've been grappling with setting up TypeScript in my ASP.NET Core project without much success.
Initially, I managed to implement a basic functionality where an alert pops up when the page loads successfully.
My next challenge was to manually convert some JavaScript code into TypeScript to gain a better understanding of its workings. I created three TypeScript files for this purpose:
index.js
// JavaScript code snippet here...
IndexInterfaces.ts
// TypeScript interface definition here...
functions.ts
// TypeScript class implementation and methods here...
Finally, here's my tsconfig.json file configuration:
// TypeScript compiler options and settings...
While trying to merge all three TypeScript files into a single output file, I encountered some strange errors as Problem 1.
In addition to that, as Problem 2, after including all three output scripts in the layout just before the closing </body> tag,
<!-- Script includes here -->
Upon loading the webpage, an error message "Uncaught ReferenceError: require is not defined" popped up. Following suggestions from online sources, I added require.js as suggested but now face a new hurdle with the error "Uncaught Error: Module name 'functions' has not been loaded yet for context: _. Use require([])".
If anyone could provide guidance on resolving these issues related to TypeScript implementation within an ASP.NET Core project, it would be highly appreciated as I'm at a loss with this setup.
EDIT: All.js
// JavaScript ES5 transpilation here...