Not that long ago, figuring out how to generate a code template for your favorite framework was a challenge in itself. Older configuration tools like Webpack, Gulp and Grunt had complex configurations to get things up-and-running.
Thankfully, today it's much easier to get a quick client-side application up-and-running with your preferred framework.
Let's take a quick look at how we can scaffold a project for React, Angular, and Vue:
You may select SWC if you'd like here as well. At a high level, it's an alternative method of compiling your code from the default. You may or may not notice a speed increase if you select it, but errors may be harder to debug as it's less commonly used.
Note
If you're following along with my book series "The Framework Field Guide", please select "JavaScript". TypeScript is useful but complex and the series' code samples do not use TypeScript, nor does the series teach TypeScript.
Run the commands printed in the final output of Vite:
cd [your-project-name]npm installnpm run dev
If all worked, once your packages are installed you should see this template screen:
Now when you modify src/App.jsx (or src/App.tsx if you selected TypeScript) it will refresh the screen for you and preview your changes immediately.
This auto-refresh on code change is called "HMR" or "Hot Module Reloading"
The Angular team maintains a CLI tool that allows you to generate new projects, upgrade existing projects, and more called Angular CLI.
Using Angular CLI, we can quickly generate an Angular project.
Pre-requisites
To get started with Angular CLI, there's a few things we should know about first:
If you're following along with my book series "The Framework Field Guide", please select "JavaScript". TypeScript is useful but complex and the series' code samples do not use TypeScript, nor does the series teach TypeScript.
Run the commands printed in the final output of Vite:
cd [your-project-name]npm installnpm run dev
If all worked, once your packages are installed you should see this template screen:
Now when you modify components/HelloWorld.vue or any other code in the project it will refresh the screen for you and preview your changes immediately.
This auto-refresh on code change is called "HMR" or "Hot Module Reloading"
Keep in mind, this is only one option for configuring your code's build tooling. There's lots of other tools and options for configuring the aforementioned tools.
Want to learn more about that? Check out my upcoming book called "The Framework Field Guide: Ecosystem", which walks you through each of the tools and how to properly configure each of them in-depth, regardless of which framework you use.