fix: Fix several lighthouse issues
This commit is contained in:
8 files changed
+36
-5
No files matched your search
@@ -18,7 +18,11 @@ export function discoverEntries(root: string, pattern: string): Record<string, s
|
||||
const appMatch = file.match(/src\/app\/(.*)\.tsx$/);
|
||||
let name = appMatch ? appMatch[1] : filename;
|
||||
|
||||
name = name.replace(/\/index$/, '') || 'index';
|
||||
// If it's src/app/articles/index.tsx -> name is 'articles/index'
|
||||
// We want it to be 'articles/index' to generate 'dist/articles/index.html'
|
||||
// Rsbuild automatically maps 'articles/index' entry to 'dist/articles/index.html'
|
||||
// The previous replace(/\/index$/, '') was stripping the 'index' making it 'articles'
|
||||
// which generates 'dist/articles.html' instead of 'dist/articles/index.html'
|
||||
|
||||
entries[name] = join(root, file);
|
||||
}
|
||||
|
||||
@@ -22,6 +22,9 @@ export function defineServiceConfig(config: RsbuildConfig = {}): RsbuildConfig {
|
||||
plugins: [pluginReact(), pluginTypeCheck()],
|
||||
html: {
|
||||
template: './src/static/index.html',
|
||||
meta: {
|
||||
description: 'Thoughts and creations of mine',
|
||||
},
|
||||
tags: [
|
||||
{
|
||||
tag: 'style',
|
||||
|
||||
Reference in new issue
Block a user