once more, with feeling

This commit is contained in:
Rich Harris
2018-07-16 19:53:32 -04:00
parent d2ee6ff3d5
commit e751cbebd5

View File

@@ -4,10 +4,10 @@ import { locations } from '../config';
import { Page, PageComponent, ServerRoute } from '../interfaces'; import { Page, PageComponent, ServerRoute } from '../interfaces';
import { posixify } from './utils'; import { posixify } from './utils';
const fallback_index = path.resolve( const fallback_index = posixify(path.resolve(
__dirname, __dirname,
'../fallback.html' '../fallback.html'
); ));
export default function create_routes(cwd = locations.routes()) { export default function create_routes(cwd = locations.routes()) {
const components: PageComponent[] = []; const components: PageComponent[] = [];
@@ -100,7 +100,7 @@ export default function create_routes(cwd = locations.routes()) {
const component = fs.existsSync(index) const component = fs.existsSync(index)
? { ? {
name: `page_${get_slug(item.file)}`, name: `page_${get_slug(item.file)}`,
file: path.join(item.file, 'index.html') file: `${item.file}/index.html`
} }
: null; : null;