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(build): Reintroduce shims for subpackage entrypoints #8050

Merged
merged 1 commit into from
Apr 24, 2024

Commits on Apr 24, 2024

  1. fix(build): Reintroduce shims for subpackage entrypoints

    This is in effect a partial rollback of PR google#7822.
    
    This should solve issues encountered by users of bunders that don't
    support exports at all (e.g. browserify) as well as ones that don't
    support it in certain circumstances (e.g., when using webpack's
    resolve.alias configuration option to alias 'blockly' to
    'node_modules/blockly', as we formerly did in most plugins, which
    causes webpack to ignore blockly's package.json entirely).
    
    Assumptions:
    - Such bundlers will _completely_ ignore the exports declaration.
    - The bundles are intended to be used in a browser—or at least not
      in node.js—so the core entrypoint never needs to route to
      core-node.js.  This is reasonable since there's little reason to
      bundle code for node.js, and node.js has supported the exports
      clause since at least v12, consideably older than any version of
      node.js we officially support.
    - It suffices to provide only a CJS entrypoint (because we can only
      provide CJS or ESM, not both.  (We could in future switch to
      providing only an ESM entrypoint instead, though.)
    cpcallen committed Apr 24, 2024
    Configuration menu
    Copy the full SHA
    19b8214 View commit details
    Browse the repository at this point in the history