Skip to content

Commit e57388e

Browse files
committed
Use non-blocking readFile
1 parent 9f8c7ea commit e57388e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

scripts/build.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ async function run(argv) {
2929
NODE_ENV: 'production',
3030
BABEL_ENV: bundle,
3131
MUI_BUILD_VERBOSE: verbose,
32-
...getVersionEnvVariables(),
32+
...(await getVersionEnvVariables()),
3333
};
3434

3535
const babelConfigPath = path.resolve(getWorkspaceRoot(), 'babel.config.js');

scripts/utils.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import path from 'path';
22
import url from 'url';
3-
import fs from 'fs';
3+
import fs from 'fs/promises';
44

55
/**
66
* Returns the full path of the root directory of this repository.
@@ -15,8 +15,8 @@ export function getWorkspaceRoot() {
1515
/**
1616
* Returns the version and destructured values of the version as env variables to be replaced.
1717
*/
18-
export function getVersionEnvVariables() {
19-
const packageJsonData = fs.readFileSync(path.resolve('./package.json'), 'utf8');
18+
export async function getVersionEnvVariables() {
19+
const packageJsonData = await fs.readFile(path.resolve('./package.json'), 'utf8');
2020
const { version = null } = JSON.parse(packageJsonData);
2121

2222
if (!version) {

0 commit comments

Comments
 (0)