Add support for Deno
Deno is a pretty solid modern JavaScript runtime that's been making a lot of great progress lately.
-
Bdodroid commented
Looks like it's pretty easy to add to a blank project, just got to tweak the dev.nix and launch.json files.
dev.nix:
{ pkgs, ... }: {
channel = "stable-23.11"; # or "unstable"
packages = [
pkgs.deno
];
env = {};
idx = {
extensions = [
"denoland.vscode-deno"
"ms-vscode.js-debug"
];previews = {
enable = true;
previews = { };
};
workspace = {
onCreate = { };
onStart = { };
};
};
}create a launch.json:
{
"version": "0.2.0",
"configurations": [
{
"request": "launch",
"name": "Launch Program",
"type": "node",
"program": "${workspaceFolder}/main.ts",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "/usr/bin/deno",
"runtimeArgs": [
"run",
"--unstable",
"--inspect-wait",
"--allow-all"
],
"envFile": "${workspaceFolder}/.env",
"attachSimplePort": 9229
}
]
}also, don't forget to initialize the Deno configuration:
CTRL+SHIFT+P "Deno: Initialize Workspace Configuration"With those changes it's working pretty well, the only real issue is the Deno package in Nix is a couple versions behind.