Is there a specific order on how the files are compiled or is there a way where I can specify which files need to be compiled first? #5888
-
To give some more information, I'm using swc as a transpiler with ts-node. I am also using mongoose with some additional mongoose plugins in my project. For those who are not familiar with it, certain mongoose plugins need to be loaded before the mongoose models are compiled for it to work correctly and I have added these plugins at the entry point (src/app.js) of my application so that they can be applied globally to all my mongoose models. When compiling the models using ts-node normally and as well with the transpile only option, this seems to work well where the mongoose plugins are loaded first and then the models. However when using the swc transpiler with ts-node it seems that the mongoose models are compiled first and then only is the entry point file compiled. Is there a way where I can specify which files needs to be compiled first or does this need to be a feature request? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
tsc
is simply wrong here. Userequire
if you don't want hoisting of imports, which is the behavior specified by the ES spec.#1686