After grunt build
ing my AngularJS app to my dist
directory, I would like to test it out with grunt server
. Problem is that grunt server
just serves up all the code in my app/
directory. Additionally, keep in mind that I created my app with yo angular
.
Here is the server task code in my Gruntfile.js
grunt.registerTask('server', [
'clean:server',
'coffee:dist',
'compass:server',
'livereload-start',
'connect:livereload',
'open',
'watch'
]);
Is there a way to make grunt server
only serve up the built code in my dist/
directory?
The very short answer is
grunt serve:dist
That works with my yeoman-generated Gruntfile.js
which contains:
grunt.registerTask('serve', function (target) {
if (target === 'dist') {
return grunt.task.run(['build', 'connect:dist:keepalive']);
}
grunt.task.run([
'clean:server',
'bower-install',
'concurrent:server',
'autoprefixer',
'connect:livereload',
'watch'
]);
});