Create pre deploy hook to automatically compile all lwc written in ts #3032
AllanOricil
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The vscode team enabled support to lwc written in TS. In the following guide, it is explained that developers must manually compile their LWC before deploying to SF.
https://developer.salesforce.com/docs/platform/lwc/guide/ts.html
https://github.com/forcedotcom/salesforcedx-vscode/releases/tag/v61.15.0
This manual process impacts negatively in DX because it has to be done manually every time before a deployment, and the lwc folder will always have both ts and compiled js, which can end up being pushed to git repositories by mistake, specially in projects that mix both js and ts while transioning. So, the idea is to automatically compile all lwc written in TS using a sf pre-deploy hook. You can automate this using the .ts extension, and the file that has the same name as the component's folder as the entrypoint. The resulting js must not be inside the component's folder to avoid the aforementioned issues.
Beta Was this translation helpful? Give feedback.
All reactions