-
-
Notifications
You must be signed in to change notification settings - Fork 184
Open
Labels
feature requestscope: transpileAny transpilation not directly related to code transformsAny transpilation not directly related to code transforms
Description
There are two problems about this field.
First:
TypeScriptToLua/src/transpilation/resolve.ts
Lines 13 to 19 in 93ff05d
| const resolver = resolve.ResolverFactory.createResolver({ | |
| extensions: [".lua"], | |
| enforceExtension: true, // Resolved file must be a lua file | |
| fileSystem: { ...new resolve.CachedInputFileSystem(fs) }, | |
| useSyncFileSystemCalls: true, | |
| symlinks: false, // Do not resolve symlinks to their original paths (that breaks node_modules detection) | |
| }); |
The resolver should add conditions to support export conditions in a published module's package.json like:
{
"exports": {
"./client": {
"require": "./dist/client/index.lua",
"types": "./src/index.ts"
}
},
}
I guess we should add ["node", "require"], and maybe "tstl" ?
Related doc:
- https://nodejs.org/api/packages.html#conditional-exports
- https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/#esm-nodejs
Second:
| resolved = resolve.sync(query, { basedir, extensions: [".js", ".ts", ".tsx"] }); |
resolvePlugin use node-resolve rather than enhanced-resolve, which not support this "exports" field.Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
feature requestscope: transpileAny transpilation not directly related to code transformsAny transpilation not directly related to code transforms