©TriMoon™
Explore posts from serversglobalThis woes with VSCode Deno extensions LSP
If you noticed, i am explicitly creating a entry on
globalThis
with an instance of this class on use inside the constructor
.
I only export the class itself not the instance, so that when you use new Debug()
anywhere in your code the instance is also available on the globalThis.debug
member.11 replies
fix library version of a dependency
@pihentagy I just found this that you might want to take a look at, it might help you in this case: https://jspm.org/docs/integrations
Especially when combined with: https://jspm.org/docs/integrations#nodejs-loader
7 replies
fix library version of a dependency
Seems like they use a
Package.json
file to define the version used.
I have no idea how to override that... (Still new to deno myself too)
Maybe try to use vendor
and change that file for your own version? 🤔
AFAIK, the vendor
option is like making the package a devVersion
that creates local package dependancies in your workspace.7 replies
fix library version of a dependency
That version must be a dependancy of
[email protected]
, that you are not able to override like that...
Depending on how that module imports gcp-metadata
, you might be able to override it maybe using a import-map
definition that targets the exact version they use in their import statements....
Maybe you need to use vendor
🤷♀️7 replies
error: Relative import path "@std/http/file-server" not prefixed with / or ./ or ../
import
s need an file to import from in Javascript/es-modules at all times.
The standard lib is a collection of modules, that you can use but are not build-in into deno
, so you need one of these in your deno.json
:
-
-
Or prefix it directly with jsr:
or npm:
in your module, like coty
said above...
- See also: https://docs.deno.com/runtime/fundamentals/configuration/#dependencies4 replies
deno install Omit/exclude dev dependencies from package.json
Hmmmm, is it just me or....
Deno
is a runtime environment (just like Node
) that runs your code or optionally build
an executable that already eliminates stuff using tree-shaking.
- It is not a bundler
, for that you need to use external tools like esbuild
.
devDependencies
are relevant when building the final product (the executable
) from scratch, but not when bundling
just the code you wrote that makes use of those...
To make it clear: install
needs all devDependencies
to build an executable...14 replies
Help setting up a Deno project for a static HTML5 app using TypeScript and a Live-preview.
For future readers of this thread:
For time being i think i will just use https://github.com/guybedford/es-module-shims in my html pages to directly load
TypeScript
files in the browser while learning TS and Life-Previews...
🖖12 replies
Help setting up a Deno project for a static HTML5 app using TypeScript and a Live-preview.
I didn't even know of the existance of that command in VSCode/Codium 🤣
Any idea how to create a task that opens the current html page with that command?
(Maybe it can replace that Life Preview extension...)
edit: I just noticed that browser is unable to open local files using
file:///abs-path/index.html
, so i would still need a webserver or serve.js
(The latter is provided by Life Preview already) 😥12 replies
Help setting up a Deno project for a static HTML5 app using TypeScript and a Live-preview.
I just opened it 😄
https://github.com/denoland/vscode_deno/issues/1251
12 replies
Help setting up a Deno project for a static HTML5 app using TypeScript and a Live-preview.
Yes im currently using https://github.com/microsoft/vscode-livepreview but would have expected this to be a functionality of https://github.com/denoland/vscode_deno itself, maybe i should open a RFE on their repo...
12 replies
Help setting up a Deno project for a static HTML5 app using TypeScript and a Live-preview.
@mattvr
Hi sorry to bother you here on the deno discord https://discord.com/channels/684898665143206084/1303058049208025149/1335357437036859392, but...
I tried to ask you this in a DM, but it could not be delivered, and you didn't accept my friend-request yet so 😉
Is there any
VSCode-extension
that provides Life-Preview using dsbuild
that i can use? (If not maybe an idea for you...)
It would make dsbuild
a lot more popular and useful 😉12 replies
Help setting up a Deno project for a static HTML5 app using TypeScript and a Live-preview.
ok so after some fiddling with
dsbuild
and some patches by the author, im finally able to serve the src-pages on my machine, still in original es-modules no TypeSript yet.
Next steps:
- Live preview inside Codium
, the deno
extension doesn't have a preview it seems arf 🤷♀️
- Translate my modules to TypeScript.
Stay tuned 😄12 replies