Auke
Setup for using npm packages locally + via server.ts
Hi Deno,
I have a project in which I use Deno both to execute
ts
/js
files locally to compute features, using a command like:
deno run --allow-all --v8-flags=--max-old-space-size=2192 compute.ts
This compute.ts
script uses .js
scripts that are also used in a webpage I serve using a simple server.ts
file, which I serve using deno:
deno run -A server.ts
which contains the following code to serve files:
and serves plain html
, .js
and .ttf
files.
I have this setup working for a long time, but it is a mess - I have installed npm
libraries using npm
, access those javascript files by using direct paths:
import * as FloBezier from "./node_modules/flo-bezier3/browser/index.js";
and I do this as a solution to have this javascript file working both locally (using deno run cli) and when accessing the file through the browser (using the server.ts above).
Is there a more cannonical approach to doing this? Key requirement is being able to use the same js
file both locally and in the browser8 replies
`deno run` not returning
Hi - I have added the following code to my javascript file, and for some reason the code still executes fine, but it doesn't return anymore, leaving deno running and I have to
ctrl-c
out of it.
This prints out the setup paper
. I have added some prints surrounding my entry point main, and those all print as well:
So what could be keeping the deno
instance from returning/finishing?25 replies