1 // Generated on 2013-12-27 using generator-ember 0.8.0
3 var LIVERELOAD_PORT = 35729;
4 var lrSnippet = require('connect-livereload')({port: LIVERELOAD_PORT});
5 var mountFolder = function (connect, dir) {
6 return connect.static(require('path').resolve(dir));
10 // for performance reasons we're only matching one level down:
11 // 'test/spec/{,*/}*.js'
12 // use this if you want to match all subfolders:
13 // 'test/spec/**/*.js'
15 module.exports = function (grunt) {
16 // show elapsed time at the end
17 require('time-grunt')(grunt);
18 // load all grunt tasks
19 require('load-grunt-tasks')(grunt);
31 files: '<%= yeoman.app %>/templates/**/*.hbs',
32 tasks: ['emberTemplates']
35 files: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
36 tasks: ['compass:server']
39 files: ['<%= yeoman.app %>/scripts/{,*/}*.js'],
44 livereload: LIVERELOAD_PORT
48 '<%= yeoman.app %>/*.html',
49 '{.tmp,<%= yeoman.app %>}/styles/{,*/}*.css',
50 '<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
57 // change this to '0.0.0.0' to access the server from outside
62 middleware: function (connect) {
65 mountFolder(connect, '.tmp'),
66 mountFolder(connect, yeomanConfig.app)
73 middleware: function (connect) {
75 mountFolder(connect, '.tmp'),
76 mountFolder(connect, 'test')
83 middleware: function (connect) {
85 mountFolder(connect, yeomanConfig.dist)
93 path: 'http://localhost:<%= connect.options.port %>'
102 '<%= yeoman.dist %>/*',
103 '!<%= yeoman.dist %>/.git*'
111 jshintrc: '.jshintrc',
112 reporter: require('jshint-stylish')
116 '<%= yeoman.app %>/scripts/{,*/}*.js',
117 '!<%= yeoman.app %>/scripts/vendor/*',
118 'test/spec/{,*/}*.js'
125 urls: ['http://localhost:<%= connect.options.port %>/index.html']
131 sassDir: '<%= yeoman.app %>/styles',
132 cssDir: '.tmp/styles',
133 generatedImagesDir: '.tmp/images/generated',
134 imagesDir: '<%= yeoman.app %>/images',
135 javascriptsDir: '<%= yeoman.app %>/scripts',
136 fontsDir: '<%= yeoman.app %>/styles/fonts',
137 importPath: 'app/bower_components',
138 httpImagesPath: '/images',
139 httpGeneratedImagesPath: '/images/generated',
140 httpFontsPath: '/styles/fonts',
141 relativeAssets: false
150 // not used since Uglify task does concat,
151 // but still available if needed
155 // not enabled since usemin task does concat and uglify
156 // check index.html to edit your build targets
157 // enable this task if you prefer defining your build targets here
165 '<%= yeoman.dist %>/scripts/{,*/}*.js',
166 '<%= yeoman.dist %>/styles/{,*/}*.css',
167 '<%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp}',
168 '<%= yeoman.dist %>/styles/fonts/*'
174 html: '.tmp/index.html',
176 dest: '<%= yeoman.dist %>'
180 html: ['<%= yeoman.dist %>/{,*/}*.html'],
181 css: ['<%= yeoman.dist %>/styles/{,*/}*.css'],
183 dirs: ['<%= yeoman.dist %>']
190 cwd: '<%= yeoman.app %>/images',
191 src: '{,*/}*.{png,jpg,jpeg}',
192 dest: '<%= yeoman.dist %>/images'
200 cwd: '<%= yeoman.app %>/images',
202 dest: '<%= yeoman.dist %>/images'
209 '<%= yeoman.dist %>/styles/main.css': [
210 '.tmp/styles/{,*/}*.css',
211 '<%= yeoman.app %>/styles/{,*/}*.css'
219 /*removeCommentsFromCDATA: true,
220 // https://github.com/yeoman/grunt-usemin/issues/44
221 //collapseWhitespace: true,
222 collapseBooleanAttributes: true,
223 removeAttributeQuotes: true,
224 removeRedundantAttributes: true,
225 useShortDoctype: true,
226 removeEmptyAttributes: true,
227 removeOptionalTags: true*/
231 cwd: '<%= yeoman.app %>',
233 dest: '<%= yeoman.dist %>'
241 ember: 'bower_components/ember/ember.js',
242 ember_data: 'bower_components/ember-data-shim/ember-data.js'
246 {src: '<%= yeoman.app %>/index.html', dest: '.tmp/index.html'}
252 ember: 'bower_components/ember/ember.prod.js',
253 ember_data: 'bower_components/ember-data-shim/ember-data.prod.js'
257 {src: '<%= yeoman.app %>/index.html', dest: '.tmp/index.html'}
261 // Put files not handled in other tasks here
267 cwd: '<%= yeoman.app %>',
268 dest: '<%= yeoman.dist %>',
272 'images/{,*/}*.{webp,gif}',
297 templateName: function (sourceFile) {
298 var templatePath = yeomanConfig.app + '/templates/';
299 return sourceFile.replace(templatePath, '');
304 '.tmp/scripts/compiled-templates.js': '<%= yeoman.app %>/templates/{,*/}*.hbs'
311 filepathTransform: function (filepath) {
312 return 'app/' + filepath;
315 src: '<%= yeoman.app %>/scripts/app.js',
316 dest: '.tmp/scripts/combined-scripts.js'
321 grunt.registerTask('server', function (target) {
322 if (target === 'dist') {
323 return grunt.task.run(['build', 'open', 'connect:dist:keepalive']);
331 'connect:livereload',
337 grunt.registerTask('test', [
346 grunt.registerTask('build', [
360 grunt.registerTask('default', [