Skip to content

v8-compile-cache doesn't allow to use dynamic import in yarn.config.cjs #342

Closed
@koshic

Description

Why is this a problem? Newest packages (like globby) shipped only in ESM format, so they can't be used in yarn.config.cjs.

Initial issue from yarn repo - yarnpkg/berry#5987
Root cause - zertosh/v8-compile-cache#41, missed importModuleDynamically callback.

There is no way to disable v8-compile-cache from yarn launched via corepack, users must manually add DISABLE_V8_COMPILE_CACHE=1 to their environments.

I propose to disable v8-compile-cache for yarn like that:

if (locator.name !== `npm` || semver.lt(locator.reference, `9.7.0`))
// @ts-expect-error - No types
await import(`v8-compile-cache`);

Or use something more complicated, like additional package.json field.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions