Universal JS Boilerplate
This is a scaffolding project that includes boilerplate code for:
- Node
- Heroku configuration
- Babel, Babel runtime, ES6/2015, ES7/2016
- Express, with a default server, some example code and routes, static file sharing, and proxy code
- Node-sass, some example SCSS, grids, normalize and typeplate css kits (installed from bower)
- Example files/resources
- An example .gitignore for the project
- A host of npm scripts for watching and building your files
- Documentation and testing scaffolds
How to get started
-
Start your own project folder with a git clone, and if you plan to push this clone to GitHub, you'll need to change your origin:
cd ~/Github\ Projects/git clone git@github.com:matthiasak/universal-js-boilerplate.git NEWPROJECTcd NEWPROJECTgit remote remove origingit remote add origin YOUR_SSH_ADDRESS -
Install prerequisites
npm install -
Start your server:
npm run s# Alternatively, if you need nodemon to auto-reload your server# (when doing server-side work)# npm run server -
Ready to push your code live, and want to minify your code with uglifyjs?
npm run build
Changelog
- Oct 21, 2015
- Build system and package.json changes: Tools are now installed per project, due to difficulties in global tool/version management. Tools are also now included as a dependency (installed with
npm install
), so that build tools can run both local server or on platforms like Heroku. When you push to platforms like Heroku, the package.json will automatically build the source files and flush them into the dist folder. This eliminates the need to manage the built js and css files in Git, so they are now in.gitignore
. npm run watch
no longer uglifies by default, and automatically builds source maps with-d
option for browserifymocha
is configured to run with babel, so tests and files can be run with ES7/6esdoc
is automatically installed and provided with a config file to help with generating documentation for DocBlocks. Installdocblockr
(Sublime Text) or similar plugins to make this easy.- PostCSS removed in favor of node-sass, because despite the speed benefits, no one releases anything in PostCSS, nor does PostCSS have perfect support for advanced Sass language syntax like mixins and interpolation.
- React has been upgraded to v0.14
- Build system and package.json changes: Tools are now installed per project, due to difficulties in global tool/version management. Tools are also now included as a dependency (installed with
License
MIT.