fixed grunt dev so pushstate routes now work ( 404 -> index.html)

This commit is contained in:
Senad Uka
2015-02-22 13:28:21 +01:00
parent 2b6d93a437
commit 3af52737d4

View File

@@ -23,7 +23,16 @@ module.exports = function(grunt) {
server: {
options: {
port: 3001,
base: 'build'
base: 'build',
middleware: function(connect, options) {
return [
function(req, res) {
var filename = 'build/' + req.url;
if ((filename === 'build//') || !grunt.file.exists(filename)) filename = 'build/index.html';
res.end(grunt.file.read(filename));
}
];
},
}
}
},
@@ -58,9 +67,12 @@ module.exports = function(grunt) {
},
force: true
},
files: [
{expand: true, flatten: true, src: ['build/ribica.bundle.js'], dest: 'build/'}
]
files: [{
expand: true,
flatten: true,
src: ['build/ribica.bundle.js'],
dest: 'build/'
}]
}
},
concat: {