How do I code directly in VSCode and preview the result on my web page?
-
Hello everyone!
I'm a total CAD newbie, but as a front-end developer I'm hoping I can pick this up - hence my question!
I'd like to use some libraries offered by JS ecosystem, so I don't think writing code in the browser itself is ideal. I'd like to use VSCode tooling, extensions, intelisense or even TypeScript while I'm designing something. How can I achieve this? Are there any tutorials I can follow?
-
@ucimo Welcome!
There are several users using JSCAD with TypeScript. Hopefully, someone will provide a few tips.
There's also an extension for VSCode to review designs. I haven't seen any updates but @crysislinux has been actively in this user group before.
-
@ucimo there are two plugins for vscode to preview jscad designs on the market.
Also you can edit your script in vscode and drag drop the file to https://openjscad.xyz after enabling auto-reload there. It will not work for typescript out of the box, but you can setup esbuild to bundle into js file and drag drop that file in openjscad for preview.
There is also https://jscad.app that is not yet official, it is a protoype for new jscad preview/edit . It supports typescript (transpiles it on the fly) and has some perf improvements too. If you feel chatty you can join the jscad discord channel also.
-
@ucimo you might want to take a look at
jscad-nowhttps://github.com/danmarshall/jscad-now
I'd like to upgrade this to use Vite (or another bundler) so that we can use TypeScript.
-
@z3dev thank you, nice extension
-
@danmarshall I think this is exactly what I was hoping to find! I'll look into it. Thank you!
-
@danmarshall Looks great.
I can't get it to work.
It just reports "Error: Cannot find module 'jscad/modelling' when I run "node jscad-now" from my home directory on linux ubuntu.
Any ideas (yes I'm a developer but not a regular Nodejs user) ?
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login