Skip to content

Instantly share code, notes, and snippets.

@marianboda
Last active August 29, 2015 14:02
Show Gist options
  • Save marianboda/70ffa2a8afa75ceee750 to your computer and use it in GitHub Desktop.
Save marianboda/70ffa2a8afa75ceee750 to your computer and use it in GitHub Desktop.

Front-end build setup

Tools used

Configure environment

  1. Install node.js follow instructions on node.js homepage: nodejs.org

  2. In the GUI root dir (where package.json is) run in terminal:

     npm install
    

    This installs all the node modules listed as dev-dependencies in package.json including Gulp and Bower.

  3. Now we need Gulp installed globally so we can run gulp commands from terminal:

     npm install -g gulp
    

    If this command cannot be run due to permissions, it is not recommended to use sudo for package management but to change owner of the /usr/local directory instead (more info here):

     sudo chown -R $USER /usr/local
    
  4. Run build:

     gulp
    

    This runs all tasks defined as "default" in gulpfile.coffee. Currently:

    • transpile .coffee files into .js -> app/js
    • copy .js files into app/js
    • download bower dependencies to lib folder
    • copy non-bower libs to lib folder
    • injects .js dependencies into index.html template

    This is all for a build

Run watcher for development

For a file watcher, which will automatically compile coffeescript into js, and which copies source js files into app/ directory, run:

    gulp watch

to be done:

  1. LESS lib bower - broken link due to version number in filename (wrong main file too) - is hardcoded for now
  2. LESS to CSS
  3. for production build also concatenation and minification is possible
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment