I am learning TypeScript and the code that I transpiler cannot use because of an error in the html, it is this:
I'm trying to use transpiled code on my html
html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
</body>
<script type="module" src="./dist/app.js"></script>
</html>
my directory:
package.json:
{
"name": "ts",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "MIT"
}
tsconfig.json:
{
"compilerOptions": {
"target": "es5",
"moduleResolution": "classic",
"outDir": "./dist",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true
}
}
As you can see is very simple but I don't really understand why I can't, I search for a time and I saw something about module loaders, and build tools, but I don't catch it, and I don't know how implement them.