Self-paced

Explore our extensive collection of courses designed to help you master various subjects and skills. Whether you're a beginner or an advanced learner, there's something here for everyone.

Bootcamp

Learn live

Join us for our free workshops, webinars, and other events to learn more about our programs and get started on your journey to becoming a developer.

Upcoming live events

Learning library

For all the self-taught geeks out there, here is our content library with most of the learning materials we have produced throughout the years.

It makes sense to start learning by reading and watching videos about fundamentals and how things work.

Search from all Lessons


LoginGet Started
← Back to Lessons
  • html-css

  • vanilla-js

Edit on Github

Start a project with Vanilla.js

1) How do I run my code?

Start coding in 30 seconds by opening this template in a new cloud computer here.

Or you can download the template into your computer and manually install it by following the steps below:

  1. Remember to install the npm packages first:
1npm install
  1. Build and Start coding!

Build the application for the first time...

1npm run start

And start coding your Vanilla.js application, update the src/index.html, src/style.css or src/app.js depending on your needs.

1) How do I run my code?

  • Type on the command line $ npm run start, look on the terminal for your project URL to open it.

2) Where do I write my code?

It depends on the language, but you have ./src/app.js, ./src/style.css and ./src/index.html respectively, you can add new .html as you please, just make sure to import it on the app.js.

Note: remember that the JS workflow starts inside window.onload.

3) I don't see my changes

Every time you change any file inside the ./src folder the website's public URL will automatically refresh the changes (it's a process called hot deploy) Remember also to refresh cleaning the cache (command+shift+r on Mac, control+shift+r on PC & Linux)

4) How do I include more images on my project?

Add them inside the ./src/assets/img folder and import them from any of your JS files. E.g: import "../assets/img/rigo-baby.jpg";

5) How do I include more JS files?

Just add the files into the JS folder and import the files/variables into your app.js. E.g: import myVar from "./file2.js"

6) How do I publish the website?

This boilerplate is 100% compatible with the free Github pages hosting. Publish your website by running:

1npm run deploy

Very easy and in just one step! Push to your main branch and use the free hosting that comes with GitHub pages, the project is ready to be published. Remember to choose to run the Github Page from your master branch.