Requirements: Make sure you have node version 8
$ npm install
Build the application for the first time...
$ npm run start (for Gitpod, linux, mac or windows users)
$ npm run c9 (for c9 users)
And start coding your Vanilla.js application, update the src/index.html
, src/index.scss
or src/index.js
depending on your needs.
- If you are in Gitpod: Just
$ npm run gitpod
and click on Open Browser. - If you are in your own environment
$ npm run start
and type localhost on the browser. - If you are in Cloud9: Just
$ npm run c9
and click on Preview -> Preview Running Application.
It depends on the language, but you have ./src/js/index.js
, ./src/style/index.scss
and ./isrc/index.html
respectively, you can add new .html
as you please, just make sure to include import it on the index.js.
Note: remember that the JS workflow starts inside window.onload
.
Everytime you change any file inside the ./src
folder the website public URL will automatically refresh the changes (its a process called hot deploy)
Remember also to refresh cleaning the cache (command+shift+r on mac, control+shift+r on pc & linux)
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";
Just add the files into the JS folder and import the file/variables into your index.js. E.g: import myVar from "./file2.js"
This boilerplate is 100% compatible with the free github pages hosting. Publish your website by runing:
$ npm run deploy
Very easy and in just one step! Push to your master 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.