I have been trying to implement modules into my project, but it didn't work so I tried it on a smaller scale; where I got the same problem. In my main .html file I do have the type="module" src="main.js" link. Besides the main.ts file I also have a dashboard.ts file in a folder where I simply made a variable called trips and stored a array in it. I exported it like normal and in the main.ts file I imported it. However, when I run this on the browser it gives me the problem that export is not defined with the compiled in main.js. I know that I probably have to do something in the tsconfig.json file, but even when I changed some parts, it still didn't work.
Is there anything I'm missing? Just in case I will show the tscondig.json file:
{
"compilerOptions": {
"target": "ES5", //verander naar es2017
"experimentalDecorators": true,
"useDefineForClassFields": false,
"module": "ESNext", //verander naar ESNext
"moduleResolution": "Node",
"moduleDetection": "force",
"strict": true,
"sourceMap": true,
"resolveJsonModule": true,
"isolatedModules": true,
"esModuleInterop": true,
"noEmit": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"skipLibCheck": true,
"lib": ["ESNext", "DOM"]
},
"exclude": ["./node_modules"]
}