Last active
August 29, 2015 14:10
-
-
Save tarrsalah/c3290921652d3c59d3df to your computer and use it in GitHub Desktop.
gulp boilerplate for ember.js [deprecated]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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