Skip to content

Commit

Permalink
Fix: too many open files (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
robisim74 committed Jun 8, 2023
1 parent bbbdd94 commit 2a3ad62
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 36 deletions.
2 changes: 1 addition & 1 deletion docs/tutorial-routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ src/routes/
layout.tsx
```

Now let's handle it. Create `plugin.ts` in the root of the `src/routes` directory::
Now let's handle it. Create `plugin.ts` in the root of the `src/routes` directory:

_src/routes/plugin.ts_
```typescript
Expand Down
56 changes: 28 additions & 28 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@
"qwik-speak-extract": "./packages/qwik-speak/extract/cli.js"
},
"devDependencies": {
"@builder.io/qwik": "1.1.4",
"@builder.io/qwik-city": "1.1.4",
"@builder.io/qwik": "1.1.5",
"@builder.io/qwik-city": "1.1.5",
"@playwright/test": "^1.32.3",
"@types/eslint": "8.37.0",
"@types/node": "^18.16.1",
"@typescript-eslint/eslint-plugin": "5.59.1",
"@typescript-eslint/parser": "5.59.1",
"eslint": "8.39.0",
"eslint-plugin-qwik": "1.1.4",
"eslint-plugin-qwik": "1.1.5",
"typescript": "5.0.4",
"undici": "5.22.0",
"vite": "4.3.3",
"vite": "4.3.9",
"vite-tsconfig-paths": "4.2.0",
"vitest": "^0.30.1"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/qwik-speak/tools/inline/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,11 @@ export async function writeChunks(
mkdirSync(targetDir, { recursive: true });
}

const tasks: Promise<void>[] = [];
// One chunk at a time to avoid "too many open files"
for (const chunk of bundles) {
const tasks: Promise<void>[] = [];
if (chunk.type === 'chunk' && 'code' in chunk && /build\//.test(chunk.fileName)) {
const filename = normalize(`${targetDir}/${chunk.fileName.split('/')[1]}`);

// Inline
let code = chunk.code;
if (code.includes(inlinePluralPlaceholder)) {
Expand All @@ -194,8 +194,8 @@ export async function writeChunks(
tasks.push(writeFile(defaultFilename, code));
}
}
await Promise.all(tasks);
}
await Promise.all(tasks);
}

/**
Expand Down

0 comments on commit 2a3ad62

Please sign in to comment.