mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-30 02:56:20 -05:00
Merge pull request #485 from rschamp/bugfix/fastly-config
Filter before mapping to avoid returning undefined
This commit is contained in:
commit
d360494ec2
1 changed files with 6 additions and 6 deletions
|
@ -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) ? '' : '/');
|
||||
});
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue