Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix esm compatibility with jest #1005

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/cache.js
Expand Up @@ -13,7 +13,6 @@ const zlib = require("zlib");
const crypto = require("crypto");
const { promisify } = require("util");
const { readFile, writeFile, mkdir } = require("fs/promises");
const findCacheDirP = import("find-cache-dir");

const transform = require("./transform");
// Lazily instantiated when needed
Expand Down Expand Up @@ -169,7 +168,7 @@ module.exports = async function (params) {
directory = params.cacheDirectory;
} else {
if (defaultCacheDirectory === null) {
const { default: findCacheDir } = await findCacheDirP;
const { default: findCacheDir } = await import("find-cache-dir");
defaultCacheDirectory =
findCacheDir({ name: "babel-loader" }) || os.tmpdir();
}
Expand Down