Replies: 1 comment
-
Short answerThis "modules" section does what you want: "modules": {
"*": [
"./src/*"
],
"./folderA/*": "./src/folderA/*"ExamplesThere are a couple of examples of this in the recent port I did of the node-chron package. Check out the manifests for cron and luxon. The read.me also talks about this topic specifically in the manifest section. Longer answerIn the modules section, the left side controls the module specifier that is used to access the module from JavaScript; the right side is the path the module (or modules) source code. When you write this... ... the "*" means to put the modules at the root (e.g. no sub-directories). If folderA contains "compA.ts" that will be available to import with the module specified "compA.ts". Here you want to maintain the "folderA" part of the path but not "src". Instead of using "*" on the left, use the path you want in the module specifier: Modules with source code in "./src/folderA" will be available from JavaScript module specifiers starting with "./folderA/".
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Sorry about the dumb question...
I'm planning to write a big Mod with lots of source files using typescript, and these are my files:
in my main.ts:
and my manifest.json
{ "include": [ "$(MODDABLE)/examples/manifest_mod.json", "$(MODDABLE)/examples/manifest_typings.json" ], "config": { "version": 1.1 }, "modules": { "*": [ "./src/*" , "./src/folderA/*" ] }, "typescript": { "tsconfig": { "compilerOptions": { "types": [ "$(MODDABLE)/xs/includes/xs", "$(MODDABLE)/typings/global" ] } } } }And I found as long as the code is using CompA, the mod fails to load. If I move CompA.ts to the src/ folder and change the imports, things start working...
so... what's the deal?
Beta Was this translation helpful? Give feedback.
All reactions