diff options
Diffstat (limited to 'benchmark/make-project/server-stress-default.js')
-rw-r--r-- | benchmark/make-project/server-stress-default.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/benchmark/make-project/server-stress-default.js b/benchmark/make-project/server-stress-default.js index 20094daa6..cbeeeda3b 100644 --- a/benchmark/make-project/server-stress-default.js +++ b/benchmark/make-project/server-stress-default.js @@ -7,11 +7,13 @@ import { loremIpsum } from './_util.js'; export async function run(projectDir) { await fs.rm(projectDir, { recursive: true, force: true }); await fs.mkdir(new URL('./src/pages', projectDir), { recursive: true }); + await fs.mkdir(new URL('./src/components', projectDir), { recursive: true }); await fs.writeFile( new URL('./src/pages/index.astro', projectDir), `\ --- +import Paragraph from '../components/Paragraph.astro' const content = "${loremIpsum}" --- @@ -25,7 +27,10 @@ const content = "${loremIpsum}" <body> <h1>Astro</h1> <div> - ${Array.from({ length: 60 }).map(() => '<p>{content}</p>')} + ${Array.from({ length: 100 }).map(() => '<p>{content}</p>').join('\n')} + </div> + <div> + ${Array.from({ length: 50 }).map((_, i) => '<Paragraph num={' + i + '} str={content} />').join('\n')} </div> </body> </html>`, @@ -33,6 +38,12 @@ const content = "${loremIpsum}" ); await fs.writeFile( + new URL('./src/components/Paragraph.astro', projectDir), + `<div>{Astro.props.num} {Astro.props.str}</div>`, + 'utf-8' + ); + + await fs.writeFile( new URL('./astro.config.js', projectDir), `\ import { defineConfig } from 'astro/config'; |