January 08, 2020

Lightning Web Component Open Source (Beta)


Hello Trailblazers,
Local Development enables you to build, run and test your Lightning Web Components without deploying your code to your salesforce org. This will dramatically decrease the time it takes to build apps with LWC. In this blog post, we will look into installation guide and will do the installation step by step.


Prerequisites: 

  • To install the CLI, you must have Node.js installed, with at least npm 5.2+. 
  • You should be familiar with either npm or yarn. The npx tool is a package runner that installs with npm 5.2+.
  • You must have git installed
  • To install Lightning Web Components and create your first app, use the open source create-lwc-app tool.



Step 1 : Open node.js command prompt 

  • run this command > npx create-lwc-app my-app
  • This command runs node.js tool kit which inserts everything that we actually needed to fully get started with inner component development with lwc open source on local machine.


Step 2 : Here, we have to provide basic details for the app

  • Package Name : Use default name  or change it and then  Press Enter
  • Description : Provide description about the app and Press Enter
  • Author :  Provide your name and hit enter button
  • Version : You can control versioning
  • License : use default and hit enter button
  • Who is the GitHub owner of the repository? :  press enter to use default
  • What is the GitHub name of the repository? : press enter to use default
  • Select a package manager : choose npm using down arrow and press enter
  • Use TypeScript or Javascript : choose Javascript using down arrow and press enter
  • Use Custom Express Server Configuration : Type Yes or No and press enter
  • Do you want to use Edge as a browser? : type  yes and press enter



Step 3 : Once App is created in specified directory ->use following command

  • cd my-app  ->Press Enter
  • npm run watch -> Press Enter


Step 4 : Navigate to localhost




Step 5 : Navigate To VS Code

  •  use code . command and it will navigate you to vs code directly.



References:

No comments:

Post a Comment