** Setup Explained: ** Node is a server writing in the JavaScript language. We will install Node locally on your machine (used by Webpack) to improve the development experience when you are building your Vue.js apps.
(Skip if you have Node and npm already installed)
$
curl -L https://git.io/n-install | bashFor further information:
https://github.com/mklement0/n-install
** Note: ** "n" is a "node version manager" which allows you to install different versions of Node (or use "nvm" an alternative to "n"). This is helpful to make sure you have the latest version, and can change versions of Node as needed while building apps in the JavaScript community. If you have a recent version of Node, this will likely not be necessary to use our Vue.js vue-runner project.
Install n: (From: https://github.com/tj/n):
$npm install -g n
$n stable
See Node install instructions:
https://nodejs.org/en/Update NPM:
$
sudo npm install npm -gInstall n: (From:
https://github.com/tj/n):$
npm install -g nUse n to install a 'stable' version of Node:
$
$ n stable
Clone the repo:
$
git clone https://github.com/kobione/vue-runner.git** Note **: clones only 'master' branch, by default.
Change into vue-runner/ directory:
$
cd vue-runner/Note that, at first, you only have 1 branch:
$
git branch
Should see only 'master' branchRun this bash script to get local copies of 3 new branches:
(master branch + 3 more branches)$
git branch -a | grep -v HEAD | perl -ne 'chomp($_); s|^\*?\s*||; if (m|(.+)/(.+)| && not $d{$2}) {print qq(git branch --track $2 $1/$2\n)} else {$d{$_}=1}' | csh -xfs** Alternatively,** you can grab branches individually.
Check to verify that you have all branches:
$
git branch
Should see master branch + 3 more branches.
NOTE: Our project it dependent on vbuild, and npm packages.
Must install vbuild and run npm install for each branch to run properly.
Use npm to Install vbuild Globally:
$
npm i -g vbuild
vbuild is a great tool to quickly build Vue.js apps.
For more information, and alternative install instructions check out:https://github.com/egoist/vbuild
$
npm install
Note: May be package duplication via vbuild and npm packages. This is known.
For any of our branches, you can run:
$
npm run dev
** Note: ** Must stop & start server, if you switch branches.Launch your browser and go to: http://localhost:4000/
- It is suggested that if you want to use any one branch moving forward, you delete your copy of
masterbranch and create a new "master" by branching off of whichever one of the 3 branches you prefer to use.
- Only two files:
index.htmlandscripts.js- $
npm run devto launch local Python server
-OR- open file:index.htmlin your browser.Note: No Webpack, will need to manually refresh browser after each "save" in editor.
** Errors??: ** If you are trying to launch the server by typing $
npm run devand you see red errors in your terminal, try typing $npm installagain.
- Two files:
index.htmlandsrc/main.jsplus Webpack- When you "save" in your editor, will automatically reload browser
Note: The Webpack build tool auto-reloads your page, and is used to do much more.
- Use in Production: HTML, CSS, and JavaScript combined in one .vue
** For example: ** The HTML, CSS, and JavaScript inApp.vuebundles together into one component
Note: Use single file "components" to build components out of other, smaller components- When you "save" in your editor, will automatically reload browser (thanks to Webpack)