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-boilerplatefor 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 upyour 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+cto abort the watch,exitto exit the ssh-session and do avagrant haltto stop the machine orvagrant suspendto only suspend it.
You find all prepered tasks in package.json under "scripts".
The most relevant are:
npm run gulpBuilds the system clean into the "dist"-foldernpm run gulo:buildBuilds the system into the "dist"-foldernpm run gulp:watchWatches for changes to .html, .scss and .js