Page 1 of 1

Typescript / compile

Posted: Wed Jul 07, 2021 10:39 am
by w3gmbh
I wonder if we're doing it the right way.

we're coding in typescript (main.ts), after any change we run npm run compile (in order to create the main.js).
part of package.json:

"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"pack": "SwitchScriptTool --transpile . && SwitchScriptTool --pack . ..",
"compile": "SwitchScriptTool --transpile ."
},

ist here an easier way?

When will Switch check the modification?

thx in advance,

Ralf.

Re: Typescript / compile

Posted: Wed Jul 07, 2021 10:53 am
by jan_suhr

Re: Typescript / compile

Posted: Wed Jul 07, 2021 12:29 pm
by laurentd
Hi Ralf,

Just type "SwitchScriptTool --transpile ." in the Visual Studio Code terminal.
No need to reload the script or restart the flow, the effect is immediate.

Re: Typescript / compile

Posted: Wed Jul 07, 2021 7:51 pm
by Padawan
If you want to automatically run the command on save, then I think you should be able to use this vs code extension
https://marketplace.visualstudio.com/it ... .RunOnSave

I haven't tested it myself, so I can't help with the configuration.

Re: Typescript / compile

Posted: Thu Jul 08, 2021 11:17 am
by w3gmbh
Padawan,

thx! RunOnSave seems promising. I'll give it a try.

Ralf.