I am learning TypeScript and today I installed SystemJS so that I could import some files. First I only imported the main file that needed being run i.e. app.js, in index.html
<script src="node_modules/systemjs/dist/system.js"></script>
<script>
System.import('app.js');
</script>
But I got this error: https://i.sstatic.net/lz7Hm.png
So I turned my html code into this:
<script src="node_modules/systemjs/dist/system.js"></script>
<script>
System.config({
baseURL: '/',
packages: {
"/ts": {
defaultExtension: 'js'
}
}
});
System.import('app.js');
</script>
Now I am getting this error: https://i.sstatic.net/RS0k7.png
package.json:
{
"name": "ts",
"version": "1.0.0",
"description": "",
"main": "app.js",
"dependencies": {
"jquery": "^3.4.0",
"systemjs": "^3.1.2",
"typescript": "^3.4.2"
},
"devDependencies": {
"lite-server": "^2.4.0"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "lite-server"
},
"author": "",
"license": "ISC"
}
app.ts: console.log("Hello")
I am stuck at this point. Any help would be appreciated. Thanks in advance.
<script>
tag inside the first one. – Universalize