use /, not path.sep, when creating routes

This commit is contained in:
Rich Harris
2017-12-21 08:46:40 -05:00
parent 9d4890913a
commit 1bed4b0670

View File

@@ -5,7 +5,7 @@ module.exports = function create_matchers(files) {
.map(file => {
if (/(^|\/|\\)_/.test(file)) return;
const parts = file.replace(/\.(html|js|mjs)$/, '').split(path.sep);
const parts = file.replace(/\.(html|js|mjs)$/, '').split('/'); // glob output is always posix-style
if (parts[parts.length - 1] === 'index') parts.pop();
const id = (