Filip Seman
Filip Seman
DDeno
Created by Filip Seman on 11/10/2023 in #help
Is possible to run nodejs (typescript) project with esm modules?
22 replies
DDeno
Created by Filip Seman on 11/10/2023 in #help
Is possible to run nodejs (typescript) project with esm modules?
I understand you're asking why not start from scratch, but right now I'm interested in the compatibility layer
22 replies
DDeno
Created by Filip Seman on 11/10/2023 in #help
Is possible to run nodejs (typescript) project with esm modules?
Yes, i'm trying to run Nodejs project in TypeScript, but it seems that esm modules with are not fully supported by Deno
22 replies
DDeno
Created by Filip Seman on 11/10/2023 in #help
Is possible to run nodejs (typescript) project with esm modules?
@Doctor what you mean?
22 replies
DDeno
Created by Filip Seman on 11/10/2023 in #help
Is possible to run nodejs (typescript) project with esm modules?
@raunioroo Are you sure it's Node's implementation? From Typescript documentation:
If TypeScript determines that the runtime will perform a lookup for ./a.js given the module specifier "./a", then ./a.js will undergo extension substitution, and resolve to the file a.ts in this example.
To me it sounds like it's up to the runtime to implement this behaviour.
22 replies
DDeno
Created by Filip Seman on 11/10/2023 in #help
Is possible to run nodejs (typescript) project with esm modules?
Maybe i'm missing something, correct me if I am wrong
22 replies
DDeno
Created by Filip Seman on 11/10/2023 in #help
Is possible to run nodejs (typescript) project with esm modules?
Yes, you need them for esm modules in general if you want to follow the standard
22 replies
DDeno
Created by Filip Seman on 11/10/2023 in #help
Is possible to run nodejs (typescript) project with esm modules?
That's ok, but i'm wondering why it doesn't suppor standard .js import even if it's typescript file https://www.typescriptlang.org/docs/handbook/modules/reference.html#extensionless-relative-paths
22 replies
DDeno
Created by Filip Seman on 11/10/2023 in #help
Is possible to run nodejs (typescript) project with esm modules?
By proper you mean it wont work in same way like running ts-node --esm foo.ts with esm modules?
22 replies
DDeno
Created by Filip Seman on 11/19/2022 in #help
vscode unable to resolve types
Thanks! Also importMap key works, i thought it was enabled by default globally to import_map.json
8 replies
DDeno
Created by Filip Seman on 11/19/2022 in #help
vscode unable to resolve types
Ok, I'm an idiot, basic npm:@types/lodash works, I forgot about Deno: init workspace because I'm experimenting with multiple folder structures and root has deno.enable: true, but each folder is its own workspace space, so everyone needs deno.enable: true. Now typings works. For import_maps it just occurred to me now deno.json is required to points to the import map {"importMap": "./import_map.json"} so vscode plugin can infer this information.
8 replies
DDeno
Created by Filip Seman on 11/19/2022 in #help
vscode unable to resolve types
Oh, you're right that blocks are after testing import_maps.json
{
"imports": {
"lodash": "npm:lodash",
"@types/lodash": "npm:@types/lodash"
}
}
{
"imports": {
"lodash": "npm:lodash",
"@types/lodash": "npm:@types/lodash"
}
}
8 replies