Skip to content

Instantly share code, notes, and snippets.

@deanrad
Last active August 29, 2015 13:55
Show Gist options
  • Select an option

  • Save deanrad/8758990 to your computer and use it in GitHub Desktop.

Select an option

Save deanrad/8758990 to your computer and use it in GitHub Desktop.
yo Deanhtml5

Get started with the deanhtml5 generator

  • Install node v 10 or greater (Tried NVM ?? )
  • Install NPM, run npm install -g yeoman
  • Run npm install -g generator-deanhtml5
  • Make a directory and in it run yo deanhtml5
  • Give the app a title, and answer any other prompts
  • Begin to fiddle with the app and tests

You now have an HTML5 app, which needs no back end process to run it but:

  • grunt server will spin up a server, and open a browser tab in which it live-reloads code changes
  • RequireJS is set up to load config and alter the main page on DOM ready, as well as load (JS, CSS, CoffeeScript)
  • npm test will run any tests that you indicate don't require a browser environment
  • http://localhost:8080/test-runner.html will run all tests in the browser in mocha
  • grunt build or r.js -o app.build.js will produce a compiled build of the app in the dist/ directory

Other workflow benefits

  • Output of generator added to a local git repo, so your changes can be clearly seen/reverted
  • On file saves, SASS/SCSS files will be recompiled, JS will be linted
  • heroku push origin master - the site will run on heroku as a static site
  • Coffeescript is compiled at load time by the require js framework
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment