Adding Typescript to a module #13685
Unanswered
johndcollins
asked this question in
Q&A
Replies: 1 comment 1 reply
-
if you want to build a small typescript snippet, have Intellisense in vs and copy it to the wwwroot folder, use tsCompilerOptions. If you have a big typescript project, then create a folder, put your sources, package.json, your build pipeline etc. and use the "copy" assets function to copy the output of the build pipeline you created in the ts project. Check OrchardCore.Liquid -> Assets -> monaco -> liquid-intellisense.ts for an example |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm trying to add Typescript to a module and I'm running into some issues.
I've looked at some of the other modules to see how they do it, but I'm not exactly sure what I'm doing wrong.
It seems there are two ways to control the compiler options.
I'm not sure what is best.
My files are getting converted to js, but there is some code added to the js file which seems to be messing up my project:
...
Object.defineProperty(exports, "__esModule", {
value: true
});
...
This is giving me an error: exports is not defined
I've tried all the suggestions here:
https://bobbyhadz.com/blog/typescript-uncaught-referenceerror-exports-is-not-defined#nodejs---referenceerror-exports-is-not-defined
What is the correct way to add typescript to a module and get it working?
Beta Was this translation helpful? Give feedback.
All reactions