npm install -g yo gulp bower
npm install -g generator-gulp-angular
-- Make a new directory, and cd into it
yo gulp-angular [app-name]
Styles (SASS, LESS)
Compile (coffee, ES2015)
Lint
Inject
Watch
Tests
Live Reload
HTML2JS
Dependencies
Compact
Minify
Image min
Deploy
grunt.js
gulp.js
Stream
Code
File
Configuration
dir > a.txt
ps aux | grep conky | grep -v grep | awk '{print $2}' | xargs kill
.tmp
watch: {
injectJS: {
files: [
'<%= yeoman.client %>/{app,components}/**/*.js',
'!<%= yeoman.client %>/{app,components}/**/*.spec.js',
'!<%= yeoman.client %>/{app,components}/**/*.mock.js',
'!<%= yeoman.client %>/app/server.js'],
tasks: ['injector:scripts']
},
injectCss: {
files: [
'<%= yeoman.client %>/{app,components}/**/*.css'
],
tasks: ['injector:css']
},
gulp.task('scripts', function () {
var partials = gulp.src('client/app/**/*.html')
.pipe(angularTemplatecache({
root: 'app',
module: 'morffy'
}));
var app = gulp.src('dist/client/app.js');
return sq({ objectMode: true }, app, partials)
.pipe(concat('app.js'))
.pipe(ngAnnotate())
.pipe(uglify())
.pipe(gulp.dest('dist/client/'));
});
gulp.src ()
gulp.dest()
gulp.pipe ()
gulp.task()
gulp.watch()
gulp.task(name[, deps], fn)
var gulp = require('gulp'); gulp.task('default', function() { // place code for your default task here });
gulp.task('mytask', ['array', 'of', 'task', 'names'], function() {
// Do stuff
});
gulp.src(globs[, options])
[ 'client/app', 'client/app/**/*.html', 'client/app/**/*.js', '!client/app/**/*.scss', '!client/app/**/*.spec.js', '!client/app/**/*.e2e.js' ]
gulp.dest(path[, options])
gulp.watch(glob[, opts], tasks)
var watcher = gulp.watch('js/**/*.js', ['uglify','reload']);
watcher.on('change', function(event) {
console.log('File ' + event.path + ' was ' + event.type + ', running tasks...');
});
gulp.watch(glob[, opts, cb])
var gulp = require('gulp');
var coffee = require('gulp-coffee');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var imagemin = require('gulp-imagemin');
var sourcemaps = require('gulp-sourcemaps');
var del = require('del');
var paths = {
scripts: ['client/js/**/*.coffee', '!client/boewr-components/**/*.coffee'],
images: 'client/img/**/*'
};
gulp.task('clean', function(done) {
del(['build'], done);
});
gulp.task('scripts', ['clean'], function() {
// Minify and copy all JavaScript (except vendor scripts)
// with sourcemaps all the way down
return gulp.src(paths.scripts)
.pipe(sourcemaps.init())
.pipe(coffee())
.pipe(uglify())
.pipe(concat('all.min.js'))
.pipe(sourcemaps.write())
.pipe(gulp.dest('build/js'));
});
module.exports = function () {
return gulp.src('client/app/**/*.scss')
.pipe(plumber())
.pipe(sass())
.pipe(gulp.dest('client/app'));
};
var util = require ('gulp-util');
module.exports = function () {
return gulp.src('client/app/**/*.scss')
.pipe(sass())
.on('error', util.log)
.pipe(gulp.dest('client/app'));
};
// In tasks
gulp.watch([
styles
], function () {
gulp.src(styles)
.pipe(plumber())
.pipe(sass())
.pipe(gulp.dest('client/app'))
.pipe(bsync.reload({ stream: true }));
});
var gulp = require('gulp');
var browserSync = require('browser-sync').create();
// Static server
gulp.task('browser-sync', function() {
browserSync.init({
server: {
baseDir: "./"
}
});
});
// node server
server.listen(config.port, config.ip, function () {
console.log('Express server listening on %d, in %s mode', config.port, app.get('env'));
// notify the gulp task that the server is ready so bsync can start
if (config.env === 'development') {
require('ripe').ready();
}
});
// in gulp server run
nodemon: function (cb) {
return nodemon({
script: 'server/server.js',
ext: 'js',
})
.on('start', function () {
ripe.wait(function () {
bsync.reload({ stream: false });
});
});
}
https://github.com/42Zavattas/generator-bangular
MEAN full stack
https://github.com/thaiat/generator-angular-famous-ionic
Mobile full stack
<div>Icons made by <a href="http://www.flaticon.com/authors/anton-saputro" title="Anton Saputro">Anton Saputro</a> from <a href="http://www.flaticon.com" title="Flaticon">www.flaticon.com</a> is licensed by <a href="http://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0">CC BY 3.0</a></div>