Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(build): Reintroduce shims for submodule 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.)
- Loading branch information