Getting Started with Dojo 2

Dojo 2 is powerful and advanced tool for creating applications. It is mainly used for Enterprise-grade Web Application Development. In this tutorial we are going to setup the environment to create Projects in Dojo 2.
Dojo 2 requires us to install its CLI, for creating, testing, and building its applications. First run the following command in your Command Prompt.
npm install -g @dojo/cli
This command installs the Dojo's command-line tool. with which we are going to create our project. It takes sometime for the cli to get installed on your system. after the installation gets finished without and errors. run the below command to create a new project on your system.
dojo create --name myfirstapp
This command will create a basic Dojo 2 application in the newly created folder with name “myfirstapp”. your Dojo 2 project will come with all of its dependencies pre-installed. The project takes time to download to your system wait for it to complete. After the project setup is completed, navigate to the project on your command prompt as sown below.
cd myfirstapp
Now that you are in the "myfirstapp" directory, which is the Dojo 2 Project Folder. execute the below command in you command prompt for the Dojo 2 project to run on your browser.
dojo build --watch --serve
The above commands shortest version is dojo build -w -s. This command will tell Dojo 2 to build and transpile the project . The --watch or -w flag watches and rebuilds your project whenever any changes are observed and the --serve or -s flag starts a simple web server which allows us to run our application in the browser while the modifications are done. Now open Browser with link http://localhost:9999/. you should see that the dojo 2 application is up and running.

vinay kumar

Founder of, Tech Enthusiast, Normal type of Person with passion toward's work.

No comments: