This is a boilerplate to be used for JS-assignments in the course. The virtual machine (Ubuntu 32bit) will have the following default installed:
- node.js
- npm
- git
Upon npm install
the packages will be installed:
- bower
- browserify
- gulp
- sass
- jshint
- ...
Make sure you have the following installed on your system:
- Virtual Box https://www.virtualbox.org/
- Vagrant https://www.vagrantup.com/
Now, do:
-
Clone (
git clone https://github.com/1dv022/js-boilerplate.git
) this repro to the location you want the project to live. Note that git clone will create the directoryjs-boilerplate
for you if you do not specify otherwise. -
Change directory to
cd js-boilerplate
. -
Start the virtual machine using
vagrant up
(Will take a couple of minutes) -
SSH into the machine using
vagrant ssh
-
Change directory to
cd /vagrant
-
Install all dependencies (incl. bower dependencies)
npm install
(Note: will take 5-10 minutes)
-
Start out by
vagrant up
your machine and ssh into it (vagrant ssh
). Change directory tocd /vagrant
. -
Start watching for changes in the app-directory by
npm run gulp:watch
. Now you have a small webserver serving your application on the adress:http://localhost:9090
, try it out in the browser of your choise. -
Fire up the IDE of your choise (Webstorm, sublime etc.) and open the files in the
js-boilerplate
-folder orjs-boilerplate/app
-folder and start editing your application. If you make a change in an html-, css- or js-file the tasks for that file will run and the web page in your browser will autoreload. -
When you are done simply
ctrl+c
to abort the watch,exit
to exit the ssh-session and do avagrant halt
to stop the machine orvagrant suspend
to only suspend it.
You find all prepered tasks in package.json under "scripts".
The most relevant are:
npm run gulp
Builds the system clean into the "dist"-foldernpm run gulo:build
Builds the system into the "dist"-foldernpm run gulp:watch
Watches for changes to .html, .scss and .js