Skip to content

Commit

Permalink
fix: require to import with assert for .json
Browse files Browse the repository at this point in the history
Signed-off-by: Sujith <[email protected]>
  • Loading branch information
sujithvn committed Mar 2, 2023
1 parent 4c67a47 commit 1cbfcd2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/reaction/src/checkNodeVersion.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// do not support ES modules.

const semver = require("semver");
const packageJson = require("../package.json");
import * as packageJson from "./package.json" assert { type: "json" };

const requiredNodeVersion = packageJson.engines.node;
if (!semver.satisfies(process.version, requiredNodeVersion)) {
Expand Down
2 changes: 1 addition & 1 deletion apps/reaction/tests/util/setupJestTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { createRequire } from "module";

const require = createRequire(import.meta.url);
const jestProcessEnv = require("./jestProcessEnv.json");
import * as jestProcessEnv from "./jestProcessEnv.json" assert { type: "json" };

process.env = Object.assign(process.env, {
...jestProcessEnv
Expand Down

0 comments on commit 1cbfcd2

Please sign in to comment.