New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add TypeScript to deployment docs #1096
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could be confusing that in the TS code block we're not actually using TypeScript, but instead, just showing the option needed to support TS projects
I'd say that we either don't need to have a TS code block and just mention that the distDir
option is needed for TS projects.
Or we can use a TS code block like the following.
// path: `./server.ts`
import strapi from '@strapi/strapi'
strapi({ distDir: '<path_to_your_out_dir>' }).start()
Though with that approach, it's worth mentioning that the user would need to run node <path_to_your_out_dir>/server.js
as you can't run TS file directly with node.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I just have a suggestion. Feel free to ignore
// path: `./server.js` | ||
|
||
const strapi = require('@strapi/strapi'); | ||
const app = strapi({ distDir: '<path_to_your_out_dir>' }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a suggestion to keep consistency with the JS example
const app = strapi({ distDir: '<path_to_your_out_dir>' }); | |
const app = strapi({ distDir: '<path_to_your_out_dir>' }).start(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed code example
|
||
const strapi = require('@strapi/strapi'); | ||
const app = strapi({ distDir: '<path_to_your_out_dir>' }); | ||
app.start(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
app.start(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed code example
I agree we might confuse users by providing a TS code block that isn't a TS example. A callout with information regarding typescript ("if strapi typescript project then provide the distDir option") might be clearer. I'll let you judge that @pwizla @StrapiShaun . |
I like this idea. I added a callout instead and think it is much clearer. Thanks for the suggestion. |
This pull request has been mentioned on Strapi Community Forum. There might be relevant details there: https://forum.strapi.io/t/new-documentation-release-v4-5-5/24573/1 |
What does it do?
replicate the PM2 code example in the deployment page for
server.js
start command.Why is it needed?
Describe the issue you are solving.
Related issue(s)/PR(s)
Let us know if this is related to any issue/pull request