Skip to content

Commit

Permalink
Fix worker in dev mode
Browse files Browse the repository at this point in the history
  • Loading branch information
erbesharat committed Dec 9, 2024
1 parent 377a506 commit 5692d52
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/cli/src/splitRunner/splitRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class SplitRunner {

async run(): Promise<File[]> {
console.info(`Splitting group: ${this.group.name}`);
console.time("Total Splitting Time");
console.time(`${this.group.name ? `${this.group.name}-` : ""}total-time`);

const worker = new Worker(path.resolve(__dirname, "worker"), {
workerData: {
Expand All @@ -27,7 +27,9 @@ class SplitRunner {

return new Promise<File[]>((resolve, reject) => {
worker.on("message", (updatedFiles: File[]) => {
console.timeEnd("Total Splitting Time");
console.timeEnd(
`${this.group.name ? `${this.group.name}-` : ""}total-time`,
);
resolve(updatedFiles);
});

Expand Down
3 changes: 3 additions & 0 deletions packages/cli/src/splitRunner/worker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const path = require("path");

Check failure on line 1 in packages/cli/src/splitRunner/worker.js

View workflow job for this annotation

GitHub Actions / lint

A `require()` style import is forbidden

Check failure on line 1 in packages/cli/src/splitRunner/worker.js

View workflow job for this annotation

GitHub Actions / lint

'require' is not defined
require("ts-node").register();

Check failure on line 2 in packages/cli/src/splitRunner/worker.js

View workflow job for this annotation

GitHub Actions / lint

A `require()` style import is forbidden

Check failure on line 2 in packages/cli/src/splitRunner/worker.js

View workflow job for this annotation

GitHub Actions / lint

'require' is not defined
require(path.resolve(__dirname, "worker.ts"));

Check failure on line 3 in packages/cli/src/splitRunner/worker.js

View workflow job for this annotation

GitHub Actions / lint

A `require()` style import is forbidden

Check failure on line 3 in packages/cli/src/splitRunner/worker.js

View workflow job for this annotation

GitHub Actions / lint

'require' is not defined

Check failure on line 3 in packages/cli/src/splitRunner/worker.js

View workflow job for this annotation

GitHub Actions / lint

'__dirname' is not defined

0 comments on commit 5692d52

Please sign in to comment.