Skip to content

question: is there a way to validate packages with mixed dual ESM/CJS and ESM-only subpackage exports? #241

Description

@userquin

For example, this simple one userquin/unbuild-cts-issue#1 or https://github.com/unocss/unocss/blob/main/packages-presets/unocss/package.json (https://arethetypeswrong.github.io/?p=unocss%4066.0.0).

I'm interested in the cli, we use attr at UnoCSS.

Thx for this great package.

Activity

  1. andrewbranch commented on Feb 24, 2025

    @andrewbranch
    Collaborator

    Right now, there’s no built-in way to change which checks “fail” the status (cause a non-zero exit code in the CLI) per-subpath. That’s something I’d like to improve in the future, but I don’t have time to actively add new features right now.

  2. userquin commented on Feb 24, 2025

    @userquin
    Author

    yeah, that was my issue (thx):

    Image

  3. andrewbranch commented on Feb 24, 2025

    @andrewbranch
    Collaborator

    You can still use --profile esm-only, but it will apply across all subpaths.

  4. userquin commented on Feb 24, 2025

    @userquin
    Author

    We use cjs-resolves-to-esm at UnoCSS (attw configured to use the root json file here https://github.com/unocss/unocss/blob/main/.attw-esm-only.json), we have some extra checks after the build finish... I'll keep an eye to this issue, maybe if I have some time I can send a PR here.

    https://github.com/unocss/unocss/blob/main/scripts/dist-verify.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

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