The accepted answer didnโt work anymore (2015-10-20), because there were changes to connect the project structure, and connect.static was moved to its own โserve-staticโ package. Therefore, you need to adapt this answer as follows:
npm install serve-static --save-dev
it is required in the Gruntfile.js file
var serveStatic = require('serve-static');
and then change the middleware code to the following:
middleware: function(connect, options) { var middlewares; middlewares = []; middlewares.push( modRewrite( ['^[^\\.]*$ /index.html [L]'] ) ); options.base.forEach( function( base ) { return middlewares.push( serveStatic( base ) ); }); return middlewares; }
Otherwise, it works great! Helped me a lot!
Florian
source share