I only know grunt to compile all the hbs into one template file. How about others? For example, are there any tools which is able to allow me to concat all the controller files into one controller file? I also want to do the same way on all the view files, route files and so on. Thanks.
ember-cli - the future.
tapas-with-ember - more stable than ember-cli. mutewinter knows what’s up.
The specific build tool in ember-cli that will replace Grunt is called broccoli.
Thank you guys, any more?
But if I only have grunt, am I able to concat all the controller files or route files into one?
Oh! I misunderstood. The “concat” plugin will concatenate anything you want, and “cssmin” and “uglify” will min your code. The concat setup looks something like this:
concat: {
css: {
src: [
'styles/*.css'
],
dest: 'style.css'
},
js : {
src : [
'ember/config.js', 'ember/models/*', 'ember/views/*', 'ember/controllers/*', 'ember/routes/*', 'ember/components/*', 'ember/router.js', 'ember/functions/*', 'ember/fixtures/*', 'templates.js'
],
dest : 'app.js'
}
}
Checkout the full list of plug-ins here.
So I can concat all the controller files into one controller file, all the route flies into one route file, and in my index.html, just import the compressed controller file and route file, the app will still run well, right?
Yup! You can also concat your compiled templates with the rest of the files. One JS file, one CSS file, one index file and you’ve got an app.
Thank you so much!!! This really saves me a lot of time
I use lineman js which is a great workflow for ember handles all compilation and does everything grunt does and more. See http://linemanjs.com
Thanks eibrahim, I'll also take a look at lineman as you mentioned :)