Fifth-Normal-Form
Without using a framework, how do I compile natively supported TS in Deno into static JS?
For a working example see:
https://nhrones.github.io/Hot_BuenoCache/
Click the see-the-code link on the bottom left of the page!
Or just go to the repo:
https://github.com/nhrones/Hot_BuenoCache
Or just go to the repo:
https://github.com/nhrones/Hot_BuenoCache
6 replies
Without using a framework, how do I compile natively supported TS in Deno into static JS?
You could try a simple util like https://jsr.io/@ndh/build
Or, even better; roll-your-own!
Create the following module -- builder.ts
Just modify the entrypoints and outfile to suit your needs.
You can also specify to bundle or not, and minification or not.
Add the above module to you project root. Then just to run:
deno run -A --quiet builder.tsYou could also add this as a task in deno.json called build.
6 replies
cannot publish package to jsr but it uses a shared file
There is a new Discord server for JSR
https://discord.gg/hMqvhAn9xG. Perhaps you could get help there.
https://discord.gg/hMqvhAn9xG. Perhaps you could get help there.
3 replies
How to add a simple live reload?
Be aware that I'm making many link changes to the code as I move all utilities to JSR. The config utility is in flux as well as the builder utility. Its all there in public repos, but as I untangle the local references to move all to JSR, it may not work without reference errors. I got lazy with these and used local refs for the dependencies. I'll have it all moved in a day or two.
The auto-config is not required. I use it in all dev-tools because I'm lazy. I like to just type 'serve' or 'hot' in any project to get coding. I'm just a hobbyist trying to learn Web-Dev.
30 replies
How to add a simple live reload?
Yes! Whenever index.html is requested, we inject the WebSocket code to the end of the text being sent to the browser. The file itself is never modified. Any .ts-code change forces a new build/bundle to ./dist/bundle.js . This new bundle, or any change to the html or CSS files force either a globalThis.location.reload() or a remove-then-reinstall stylesheets style-refresh by way of the WebSocket.
30 replies
How to add a simple live reload?
An example WebSocket refresh that is injected on serve, and does not modify the html file. It simply modifies the text sent to the browser.
https://github.com/nhrones/Devtools_Hot/blob/main/injector.ts
This server auto-starts the browser, then on any ./src/ or ./dist/ change, it builds/bundles and then auto-refreshes the browser.
It injects the WebSocket code (above) whenever the request URL is for '/' or 'index.html' https://github.com/nhrones/Devtools_Hot/blob/main/server.ts The unique feature is that the watch-function will distinguish between a code change or a stylesheet change. For a stylesheet, it simply refreshes the styles without disturbing the app.
It injects the WebSocket code (above) whenever the request URL is for '/' or 'index.html' https://github.com/nhrones/Devtools_Hot/blob/main/server.ts The unique feature is that the watch-function will distinguish between a code change or a stylesheet change. For a stylesheet, it simply refreshes the styles without disturbing the app.
30 replies
Access default TypeScript compiler options
You can find the Deno default compiler options here:
https://docs.deno.com/runtime/reference/ts_config_migration/#ts-compiler-options
https://docs.deno.com/runtime/reference/ts_config_migration/#ts-compiler-options
2 replies
window install problem
That looks incorrect.
the line
Should have been
Note the missing backslash between yadav and ,deno.
Check that first path to see if it has a \bin folder in it.
If so something went wrong! Deno may have been added correctly in the path environment variable.
Please check your path environment variable.
in powershell enter $env:Path
It should contain: If it does, Deno may have been installed accidentally in the folder: rather than where it should be: If so, I would report this as a bug.
If so something went wrong! Deno may have been added correctly in the path environment variable.
Please check your path environment variable.
in powershell enter $env:Path
It should contain: If it does, Deno may have been installed accidentally in the folder: rather than where it should be: If so, I would report this as a bug.
11 replies