Skip to content

Instantly share code, notes, and snippets.

@tarrsalah
Last active August 29, 2015 14:10
Show Gist options
  • Select an option

  • Save tarrsalah/c3290921652d3c59d3df to your computer and use it in GitHub Desktop.

Select an option

Save tarrsalah/c3290921652d3c59d3df to your computer and use it in GitHub Desktop.
gulp boilerplate for ember.js [deprecated]
var gulp = require('gulp');
var concat = require('gulp-concat');
var declare = require('gulp-declare');
var wrap = require('gulp-wrap');
var handlebars = require('gulp-handlebars');
var watch = require('gulp-watch');
var paths = {
css : ['styles/*.css'],
scripts:['scripts/*.js', 'scripts/**/*.js'],
templates: ['scripts/templates/*.hbs', 'scripts/templates/**/*.hbs']
};
gulp.task('css', function() {
return gulp.src(paths.css)
.pipe(concat('main.css'))
.pipe(gulp.dest('dist/css'));
});
gulp.task('templates', function() {
gulp.src(paths.templates)
.pipe(handlebars({
handlebars: require('ember-handlebars')
}))
.pipe(wrap('Ember.Handlebars.template(<%= contents %>)'))
.pipe(declare({
namespace: 'Ember.TEMPLATES',
processName: function(path) {
path = path.replace('scripts/templates/', '');
var name = declare.processNameByPath(path);
return name.split('.').join('/');
}
noRedeclare: true
}))
.pipe(concat('templates.js'))
.pipe(gulp.dest('.'));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment