Merge pull request #485 from rschamp/bugfix/fastly-config

Filter before mapping to avoid returning undefined
This commit is contained in:
Ray Schamp 2016-05-17 13:50:47 -04:00
commit d360494ec2

View file

@ -29,13 +29,13 @@ var extraAppRoutes = [
*/
var getStaticPaths = function (pathToStatic) {
var staticPaths = glob.sync(path.resolve(__dirname, pathToStatic));
return staticPaths.map(function (pathName) {
return staticPaths.filter(function (pathName) {
// Exclude view html, resolve everything else in the build
if (path.extname(pathName) !== '.html') {
// Reduce absolute path to relative paths like '/js'
var base = path.dirname(path.resolve(__dirname, pathToStatic));
return '^' + pathName.replace(base, '') + (path.extname(pathName) ? '' : '/');
}
return path.extname(pathName) !== '.html';
}).map(function (pathName) {
// Reduce absolute path to relative paths like '/js'
var base = path.dirname(path.resolve(__dirname, pathToStatic));
return '^' + pathName.replace(base, '') + (path.extname(pathName) ? '' : '/');
});
};