fix: update build and test scripts to set Rayon and Tokio worker threads
This commit is contained in:
1 parent
fb8e42f632
commit
d7b8a351c1
3 files changed
+14
-5
No files matched your search
+3
-3
@@ -6,12 +6,12 @@
|
||||
"dev": "dotenv -e .env -- astro dev",
|
||||
"dev:network": "dotenv -e .env -- astro dev --host",
|
||||
"start": "dotenv -e .env -- astro dev",
|
||||
"build": "astro check && astro build",
|
||||
"build": "export RAYON_NUM_THREADS=1 TOKIO_WORKER_THREADS=1; astro check && astro build",
|
||||
"preview": "dotenv -e .env -- astro preview",
|
||||
"preview:network": "dotenv -e .env -- astro dev --host",
|
||||
"astro": "astro",
|
||||
"test": "vitest run",
|
||||
"test:watch": "vitest",
|
||||
"test": "export RAYON_NUM_THREADS=1 TOKIO_WORKER_THREADS=1; vitest run",
|
||||
"test:watch": "export RAYON_NUM_THREADS=1 TOKIO_WORKER_THREADS=1; vitest",
|
||||
"lint": "eslint .",
|
||||
"lint:fix": "eslint . --fix"
|
||||
},
|
||||
|
||||
@@ -102,7 +102,7 @@ export default function FilteredList({ entries, collection, initial }: Props) {
|
||||
)}
|
||||
</div>
|
||||
|
||||
<label class="block text-xs uppercase mb-1 text-ink-muted" htmlFor="filter-q">
|
||||
<label class="block text-xs uppercase mb-1 text-ink-muted" for="filter-q">
|
||||
Keyword
|
||||
</label>
|
||||
<input
|
||||
@@ -116,7 +116,7 @@ export default function FilteredList({ entries, collection, initial }: Props) {
|
||||
class="w-full px-2.5 py-1.5 rounded outline-none text-ink bg-chip border border-edge focus:border-edge transition-colors duration-300 ease-in-out"
|
||||
/>
|
||||
|
||||
<label class="block text-xs uppercase mt-3 mb-1 text-ink-muted" htmlFor="filter-sort">
|
||||
<label class="block text-xs uppercase mt-3 mb-1 text-ink-muted" for="filter-sort">
|
||||
Sort
|
||||
</label>
|
||||
<select
|
||||
|
||||
@@ -23,5 +23,14 @@ export default defineConfig({
|
||||
test: {
|
||||
environment: "node",
|
||||
include: ["src/**/__tests__/**/*.test.ts", "src/**/*.test.ts"],
|
||||
// Rolldown (Vite 8's bundler, loaded when Vitest reads this config) sizes
|
||||
// its native thread pool to `nproc`. On hosts that report many CPUs but
|
||||
// cannot actually spawn that many threads, the default `forks` pool aborts
|
||||
// with "spawn node EAGAIN". The `threads` pool with a single worker avoids
|
||||
// forking one child process per file; the matching RAYON/TOKIO caps live in
|
||||
// the package.json scripts.
|
||||
pool: "threads",
|
||||
maxWorkers: 1,
|
||||
fileParallelism: false,
|
||||
},
|
||||
})
|
||||
Reference in new issue
Block a user