mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-15 04:14:46 +00:00
treat foo.html and foo/index.html the same when generating manifest
This commit is contained in:
@@ -142,29 +142,26 @@ export default function create_manifest_data(cwd: string): ManifestData {
|
||||
}
|
||||
|
||||
else if (item.is_page) {
|
||||
const is_index = item.basename === 'index.html';
|
||||
|
||||
const component = {
|
||||
name: get_slug(item.file),
|
||||
file: item.file,
|
||||
has_preload: has_preload(item.file)
|
||||
};
|
||||
|
||||
const parts = stack.concat({
|
||||
component,
|
||||
params
|
||||
});
|
||||
|
||||
components.push(component);
|
||||
if (item.basename === 'index.html') {
|
||||
pages.push({
|
||||
pattern: get_pattern(parent_segments, true),
|
||||
parts
|
||||
});
|
||||
} else {
|
||||
pages.push({
|
||||
pattern: get_pattern(segments, true),
|
||||
parts
|
||||
});
|
||||
}
|
||||
|
||||
const parts = (is_index && stack[stack.length - 1] === null)
|
||||
? stack.slice(0, -1).concat({ component, params })
|
||||
: stack.concat({ component, params })
|
||||
|
||||
const page = {
|
||||
pattern: get_pattern(is_index ? parent_segments : segments, true),
|
||||
parts
|
||||
};
|
||||
|
||||
pages.push(page);
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user