https://pulumi.com logo
#typescript
Title
# typescript
c

curved-pharmacist-41509

06/22/2020, 12:36 AM
Is there any way instead to have a pre-run build step or anything for me to run
tsc -b
?
l

little-cartoon-10569

06/22/2020, 2:18 AM
Use the
compile
property of your package.json
script
block then
npm run compile
. This is the section from my package.json:
Copy code
json
  "scripts": {
    "compile": "tsc",
    "lint": "node_modules/tslint/bin/tslint --project tsconfig.json",
    "prepare": "npm run compile",
    "test": "node --trace-warnings --unhandled-rejections=strict node_modules/mocha/bin/_mocha --config test/mocha/.mocharc.json"
  },
c

curved-pharmacist-41509

06/22/2020, 2:56 AM
I was hoping some sort of hook in the pulumi cli to automatically run a command when you run
pulumi up
etc
l

little-cartoon-10569

06/22/2020, 4:35 AM
pulumi up has it built in. It compiles typescript dynamically, or something. I never see the compiled js files anywhere...
Only need the npm config stuff for running your tests.