Typescript / compile

Post Reply
w3gmbh
Newbie
Posts: 12
Joined: Mon Dec 16, 2013 4:14 pm

Typescript / compile

Post 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.
jan_suhr
Advanced member
Posts: 586
Joined: Fri Nov 04, 2011 1:12 pm
Location: Nyköping, Sweden

Re: Typescript / compile

Post by jan_suhr »

Jan Suhr
Color Consult AB
Sweden
=============
Check out my apps
laurentd
Member
Posts: 137
Joined: Wed Mar 13, 2019 2:06 pm

Re: Typescript / compile

Post 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.
Laurent De Wilde, Solution Architect @ Enfocus
Padawan
Advanced member
Posts: 358
Joined: Mon Jun 12, 2017 8:48 pm
Location: Belgium
Contact:

Re: Typescript / compile

Post 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.
w3gmbh
Newbie
Posts: 12
Joined: Mon Dec 16, 2013 4:14 pm

Re: Typescript / compile

Post by w3gmbh »

Padawan,

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

Ralf.
Post Reply