Skip to content

Instantly share code, notes, and snippets.

@shellophobia
Last active July 15, 2016 10:43
Show Gist options
  • Save shellophobia/6938c6caa338ed1917c48b9784ad0238 to your computer and use it in GitHub Desktop.
Save shellophobia/6938c6caa338ed1917c48b9784ad0238 to your computer and use it in GitHub Desktop.
Setup doc for Vuejs

#SETUP Vue.js

For local setup

  1. Install Node and npm on your machine.
    http://blog.teamtreehouse.com/install-node-js-npm-mac
    
  2. Install Gulp using the command
    npm install --global gulp-cli
    
  3. Run
    npm install
    
    to install all the package dependencies of vuejs like babelify etc.
  4. Restart your web server to accumulate the changes in application_helper.rb which overrides the javascript_include_tag.
  5. Run the following command to precompile js assets.
    gulp clean && gulp
    
  6. Now the application.js is created in public/assets/. For development purpose you can use
    gulp watch
    
    to watch the changes done in JS file. This will compile the JS resources everytime you save some change in JS files.
  7. That's all folks!!

For staging and production

  1. Install Node and npm on the staging or prod machine.
    http://blog.teamtreehouse.com/install-node-js-npm-mac
    
  2. Install Gulp using the command
    npm install --global gulp-cli
    
  3. We have to run
    npm install
    
    globally to install all the node_modules. For installing globally create a copy of "package.json" file in "/var/www". Then run "npm install" in that directory.
  4. In production.rb add a command
    gulp clean && gulp && gulp rev
    
    which runs after assets:precompile task. (Already added at the moment).
@shellophobia
Copy link
Author

P.S. This all should be done after the search page goes in production.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment