mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-15 04:14:46 +00:00
treat foo/index.json.js as foo.json.js - fixes #297
This commit is contained in:
@@ -17,7 +17,10 @@ export default function create_routes({ files } = { files: glob.sync('**/*.*', {
|
||||
|
||||
const base = file.replace(/\.[^/.]+$/, '');
|
||||
const parts = base.split('/'); // glob output is always posix-style
|
||||
if (parts[parts.length - 1] === 'index') parts.pop();
|
||||
if (/^index(\..+)?/.test(parts[parts.length - 1])) {
|
||||
const part = parts.pop();
|
||||
if (parts.length > 0) parts[parts.length - 1] += part.slice(5);
|
||||
}
|
||||
|
||||
return {
|
||||
files: [file],
|
||||
|
||||
Reference in New Issue
Block a user