Skip to content

Commit

Permalink
fix: Use execaCommand instead of node:child_process (#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
aklinker1 authored Sep 27, 2023
1 parent 5482b2f commit cf5a7d1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion e2e/tests/init.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ describe('Init command', () => {
"wxt.config.ts",
]
`);
}, 30e3);
});
});
4 changes: 2 additions & 2 deletions e2e/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { dirname, join, relative, resolve } from 'path';
import fs from 'fs-extra';
import glob from 'fast-glob';
import { execSync } from 'child_process';
import { execaCommand } from 'execa';
import { InlineConfig, UserConfig, build } from '../src';
import { normalizePath } from '../src/core/utils/paths';

Expand Down Expand Up @@ -72,8 +72,8 @@ export class TestProject {
await fs.ensureDir(fileDir);
await fs.writeFile(filePath, content ?? '', 'utf-8');
}
execSync('npm i --ignore-scripts', { cwd: this.root });

await execaCommand('npm i --ignore-scripts', { cwd: this.root });
await build({ ...config, root: this.root });
}

Expand Down
4 changes: 2 additions & 2 deletions src/core/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import fs from 'fs-extra';
import { groupEntrypoints } from './utils/groupEntrypoints';
import { formatDuration } from './utils/formatDuration';
import { printBuildSummary } from './log/printBuildSummary';
import { execSync } from 'node:child_process';
import { execaCommand } from 'execa';
import glob from 'fast-glob';
import { unnormalizePath } from './utils/paths';

Expand Down Expand Up @@ -135,7 +135,7 @@ async function combineAnalysisStats(config: InternalConfig): Promise<void> {
});
const absolutePaths = unixFiles.map(unnormalizePath);

execSync(
await execaCommand(
`rollup-plugin-visualizer ${absolutePaths.join(' ')} --template ${
config.analysis.template
}`,
Expand Down

0 comments on commit cf5a7d1

Please sign in to comment.