Using TypeScript on your POWER web hosting plan
Objective
You've subscribed to a Web POWER web hosting plan to deploy Node.js applications, and you want to deploy TypeScript code.
This guide will explain how to do it.
Find out how to install Strapi on your POWER web hosting plan.
Requirements
- A Node.js POWER web hosting plan
- access to the OVHcloud Control Panel
If you have just started to use your Web POWER web hosting plan, we suggest to have a look at our Getting started with a POWER web hosting plan guide before going further.
Instructions
TypeScript projects can't run directly by our stack, they should be compiled to JS first.
You should include typescript as dev dependency module for your project:
Create a tsconfig.json (if you don't have one already) with the following content for example (see the TypeScript doc for more information):
Build the project, either directly with tsc command:
npx tsc --project ./
or by adding the build script to the package.json:
and executing it with npm run build.
Your entrypoint should point to the one in your output dir, for example :
Go further
Join our community of users on https://community.ovh.com/en/.
Join our Discord on our web-hosting-power channel to discuss directly with the team and other users of this lab.