Files
blockly/scripts/gulpfiles
Christopher Allen 0b84d310c0 feat(build)!: Introduce ESM entrypoints for chunks
Introduce an "import" conditional export for each of the chunk
entrypoints (blockly/core, blockly/blocks, blockly/javascript
etc.), and point these at wrappers created by build_tasks.js
that import the corresponding <chunk>_compressed.js file and
export its named exports.

BREAKING CHANGE:

Importing Blockly via

    import Blockly from 'blockly/core';

(and similarly for the other chunk entrypoints) has worked until
now because most build tools (including Webpack in particular)
fuilfil the request for the default export of a CJS module by
providing the module.exports object, rather than an
explicitly-named default export as they would for an ES module.

Since core/blockly.ts (the notional entrypoint for blockly/core)
does not provide a default export, the wrappers created by this
PR do not either.

Code of the above form will therefore break, and should be updated
to use a wildcard:

    import * as Blockly from 'blockly/core';
2024-05-09 16:01:41 +01:00
..
2021-01-08 11:52:02 -08:00