Skip to content

Instantly share code, notes, and snippets.

@acedesigns
Last active October 2, 2015 16:35
Show Gist options
  • Save acedesigns/bdba1c234817b97f2552 to your computer and use it in GitHub Desktop.
Save acedesigns/bdba1c234817b97f2552 to your computer and use it in GitHub Desktop.
A run down of YoMan generator for scaffolding a static App. Just wanted to learn how it came together. Just run npm install && grunt serve
{
"directory": "app/vendor"
}
{
"name" : "Website App",
"version" : "0.1.0",
"description" : "Physics-like animations for pretty particles",
"appPath" : "app",
"moduleName" : "webSiteApp",
"dependencies": {
"angular" : "1.4.0",
"angular-animate" : "1.4.0",
"angular-bootstrap" : "0.13.3",
"angular-ui-router" : "0.2.14",
},
"authors": [
"Anele Maqanda <acedesigns123@gmail.com> (http://acedesigns.co.za)"
]
}
/* =======================================================
* Gruntfile.js
* =======================================================
*/
module.exports = function(grunt) {
require('jit-grunt')(grunt);
// Configurable paths for the application
var appConfig = {
app: require('./bower.json').appPath || 'app'
};
// Define the configuration for all the tasks
grunt.initConfig({
// Project settings
appSetting: appConfig,
watch : {
bower: {
files: ['bower.json'],
tasks: ['wiredep']
},
gruntfile: {
files: ['Gruntfile.js']
},
livereload: {
options: {
livereload: '<%= connect.options.livereload %>'
},
files: [
'<%= appSetting.app %>/{,*/}*.html',
'<%= appSetting.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
]
},
styles: {
files: ['<%= appSetting.app %>/css/{,*/}*.css']
},
js: {
files: ['<%= appSetting.app %>/js/{,*/}*.js'],
options: {
livereload: '<%= connect.options.livereload %>'
}
}
},
wiredep: {
app: {
src: ['<%= appSetting.app %>/index.html'],
ignorePath: /\.\.\//
}
},
// The actual grunt server settings
connect: {
options: {
port: 1880,
hostname: 'localhost',
livereload: 35722
},
livereload: {
options: {
open: true,
middleware: function (connect) {
return [
connect().use(
'/app/vendor',
connect.static('./app/vendor')
),
connect().use(
'/app/css',
connect.static('./app/css')
),
connect.static(appConfig.app)
];
}
}
}
}
});
grunt.registerTask('serve', 'Compile then start a connect web server', function (target) {
grunt.task.run([
'wiredep',
'connect:livereload',
'watch'
]);
});
};
<!DOCTYPE html>
<!--
____________ _.==========.-._ ____________
| | __ | |
| .''. O | o |__| |||| | | O .''. |
| : : |________________| : : |
| '..' _ |oo .,.. | _ '..' |
| (_) | ....|...... OO | (_) |
| |________________| |
| .-''-. | ________ mm| .-''-. |
| / \ | |O;;; :O| | / \ |
| ( ) | m '========' m | ( ) |
| \ / |________________| \ / |
| '-..-' |____|__|__|__|__| '-..-' |
|____________|________________|____________|
|___|====|___|___|========|___|___|====|___|
-->
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<!-- bower:css -->
<!-- endbower -->
</head>
<body>
<!-- bower:js -->
<!-- endbower -->
</body>
</html>
{
"name": "aceApp",
"version": "0.1.0",
"description": "A simple app",
"author": "Anele 'Ace' Maqanda <acedesigns123@gmail.com>",
"license": "MIT",
"repository": "",
"homepage": "http://acedesigns.co.za",
"main": "",
"dependencies": {
"grunt": "0.4.5",
"grunt-contrib-connect" : "0.8.0",
"grunt-contrib-watch" : "0.6.0",
"jit-grunt" : "0.9.1",
"grunt-wiredep" : "1.9.0"
},
"devDependencies": {
},
"contributors": [
"Anele Maqanda v0.1.0 <acedesigns123@gmail.com>"
],
"engines": {
"node": ">= 0.10.0"
},
"scripts": {
"postinstall" : "bower install"
},
"keywords": [
"angular",
"bootstrap"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment