-
Notifications
You must be signed in to change notification settings - Fork 248
Description
EDIT: Title changed and reopened. Not just improve, when imports don't work there sometimes(?) is no message at all.
I don't quite find an answer in https://github.com/Moddable-OpenSource/moddable/blob/public/documentation/tools/manifest.md
That file explains existing manifest.json files, but not what those entries mean and/or do. The only sentence to explain "modules", for example, is
The modules object describes the necessary modules on all platforms.
"modules": { "*": [ "$(MODULES)/files/resource/*", "$(MODULES)/base/instrumentation/*", ], },
So.... how does it work? What does that syntax mean?
My interpretation was that this syntax tells the compiler that all files in the paths are accessible via direct name imports (without path). And that if I have modules with a path in import statements I need additional entries, but it's not quite clear what I would put in there and if my assumption even is correct.
I have JS code with a "main.js" file including a lot of stuff in various sub directories:
Left: string used to import the module : Right: Path to the files
"*": "./DEVICE/*",
"one.core/lib/*": "./DEVICE/node_modules/one.core/lib/*",
"one.core/lib/system/*": "./DEVICE/node_modules/one.core/lib/system/*",
"one.core/lib/util/*": "./DEVICE/node_modules/one.core/lib/util/*",
Example: The code has an import * from "one.core/lib/someStuff.js" and that file is in ./DEVICE/node_modules/one.core/lib/someStuff.js relative to the project root (and the manifest file).
I tried writing the "modules" section of manifest.json like that, I'm not sure what the meaning of the left hand side and right hand side actually is after reading the documentation. Doesn't work, apparently it means something different from what I tried.