Generic Grocery Co.’s website is still plain HTML, CSS, and ES modules loaded with script tags, and its README has a fresh list of to-dos. The first one asks for an Open now badge that knows the store’s holiday hours, so on Christmas Eve it says Open now, until 3 p.m. (Christmas Eve hours). Working out when the store opens next takes date math that’s clumsy with JavaScript’s built-in Date, so the badge needs a small date library.
Teams install a library like this as an npm package, and the site’s code imports it by its name. A browser can’t find a package by its name, so once the badge imports it, the site needs a tool that serves it to the browser. That changes how the whole site runs.
In this course, you’ll turn the store’s site into a project that installs packages with npm and runs and builds with Vite, the setup that most JavaScript teams start a front-end project with today. You’ll do it on a branch, so main keeps the working site the whole time.
The store’s customers keep checking the opening hours throughout, and they never find out that their website was halfway through a move.
What You’ll Learn
This is the second course in the Tooling and Git for JavaScript Projects path, where you work on the same store’s site the way a professional team works on a project. If you’ve come to this course directly, you’re in the right place, because the starting code comes with everything the first course built, including its Git history.
The course takes the site from script tags to a Vite project, one section at a time:
- Moving to npm on a Branch starts the move on a
vitebranch of its own. You turn the site into an npm project, check a package before you install it, and commit the lockfile that records exactly what you installed. - Running the Site With Vite adds the badge’s code, which stops the home page from working in the browser. Vite’s dev server brings it back, and the build makes the files you’d publish, all four pages of them.
- Merging Main Into Your Branch fixes two holiday hours on
main, because they can’t wait for the move, and merges them intoviteso your branch doesn’t fall behind. - Project: Finish the Move hands you the remaining to-dos. You’ll show the deals for their week, take curbside pickup orders with the store’s key kept out of Git, and teach the badge to name the holiday. Last, you’ll merge
viteintomainand check it all withnpm run check. - Reviewing What You’ve Learned wraps up with a quiz and a look back at the habits you’ve built.
By the end, you’ll be able to turn a static site into an npm and Vite project on a branch. You’ll install and use a package, run the dev server, build the site, keep the lockfile and the secrets right, and merge the branch when it works. That’s the everyday workflow behind a front-end developer job, and a project you can talk through in an interview.
How the Course Works
Most lessons are text, and you follow along in your own terminal and editor. A few short videos picture what Git does with branches and merges, with their key points written out below them. Every lesson starts from a problem in the store’s project. Along the way, you’ll run into a few mistakes that almost everyone makes with npm and Vite. That’s expected, and each time, the lesson explains what happened and how to do it differently.
You’ll get the starting code in the next lesson. It’s the store’s site at the start of this course, as a ZIP that includes the hidden .git folder, so git log shows the whole history so far:
If you kept your own repository from the first course, then you can keep working in it instead, and the next lesson shows you which files to copy over.
The project has a check script that inspects your repository, and in this course it becomes npm run check. It marks each check with ✔, ✘ or !, and gives you a next step for every problem it finds. Quizzes and coding exercises let you test yourself, and at the end, the mentor reviews your project with you. Wherever you see a mentor button, click it to open a conversation with the mentor.
What You Should Know Already
This course assumes that you’ve written JavaScript and worked in a Git repository before. In particular, you should be comfortable with the following:
- Writing JavaScript with modules, using
importandexport - Running a Node script from a terminal, and moving between folders with
cdandls - Serving a site locally and publishing it by uploading its files
- Committing changes with Git, ignoring files with
.gitignore, and readinggit diffandgit log
You don’t need any experience with npm or Vite. If you’ve pasted an npm install from a tutorial or an AI assistant without knowing what it did, that’s completely fine, because this course explains every command when you need it.
In the next lesson, you’ll get the store’s site onto your computer and check that it runs and that Git remembers every commit.