I have integrated a module from a private git repository.
Package.json:
"my-module": "git+https://username:<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="cebeb98eaca7baacbbada5abbae0a1bca9">[email protected]</a>/username/repo.git"
The repository contains a TypeScript file:
export class MyClass {}
This module is designed to work in both node and browser environments.
However, I encounter an error when running it in my node environment:
SyntaxError: Unexpected token export
(function (exports, require, module, __filename, __dirname) { export class MyClass {}
The imported module does not have a dist folder (i.e., it is not precompiled).
What could be causing this issue? Should I precompile the module and reference the dist folder, or is there a way to directly access the source files?
Both the imported module and the importing project have a tsconfig.json with
target: "es6", module: "commonjs"