I have a typescript file of a module I created
export function hello() {
  console.log('hello');
}
export function bye() {
  console.log('bye');
}
in my html I have actions like such:
  <head>
    <script src="./assets/js/myModule.ts" type="module"></script>
  </head>
  <body>
    <span onclick="myModule.hello()">Press to greet</span>
  </body>
...
The app has a server.js file:
const proxy = require("http-proxy-middleware").createProxyMiddleware;
const Bundler = require("parcel-bundler");
const express = require("express");
const bundler = new Bundler("index.html");
const app = express();
app.use(
  "/api",
  proxy({
    target: process.env.API_SERVER || "http://localhost:1337/"
  })
);
app.use(bundler.middleware());
app.listen(Number(process.env.PORT || 1234));
But everytime I launch the server, I get an error:
myModule is not defined
I tried already:
- Using npm link.
- requiring the file in the server.js and passing it with app.use(myModule.ts)
 
    