Skip to content

Commit

Permalink
fix: move dynamic import from top file into function
Browse files Browse the repository at this point in the history
  • Loading branch information
ahce committed Aug 12, 2023
1 parent c9d65eb commit c47e4e4
Showing 1 changed file with 1 addition and 2 deletions.
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

0 comments on commit c47e4e4

Please sign in to comment.