Prerequisite -
1. We should have VS code installed in our system.
2. VS code should have required plugin for Salesforce.
3. Connect your org to VS code
Here are steps to create lightning web component in VS code.
Step 1 -
Press Ctrl + Shift + P in windows VS code.
Step 2 -
Type SFDX : Create lightning web component and Press Enter
Step 3 -
Type required web component name, In my case it will be LW_HelloWorld, then press Enter.
It will automatically create below three files -
- LW_HelloWorld.html
- LW_HelloWorld.js
- LW_HelloWorld.js-meta.xml
Step 4 -
Paste below code in your LW_HelloWorld.html
<template>
Hello World
</template>