| 1 |
const path = require('path'); |
| 2 |
|
| 3 |
module.exports = { |
| 4 |
entry: { |
| 5 |
// Folds into the SPA bundle via react-src/generated/moduleManifest.ts (Constitution |
| 6 |
// XIII). That bundle is enqueued unconditionally by Admin::enqueue_scripts(), which |
| 7 |
// runs on the editor screen too — the same reach the retired enqueue_module_assets() |
| 8 |
// glob gave this module's own bundle, so registerBlockType still runs there. |
| 9 |
'modules/block-patterns': path.resolve(__dirname, 'assets/js/index.tsx'), |
| 10 |
|
| 11 |
// The stylesheet must stay a REAL entry (unprefixed key → assets/css/style-block-patterns.css |
| 12 |
// — @wordpress/scripts prefixes `style-` when the source file is named `style.scss`), |
| 13 |
// because it is the one piece of this module that does NOT ride the SPA bundle: the |
| 14 |
// placeholder renders inside the editor's canvas IFRAME, which only sees what |
| 15 |
// `enqueue_block_assets` puts there. Imported from the JS index instead, it would be |
| 16 |
// swept into style-templately.css along with every other module's CSS — a file that is |
| 17 |
// enqueued on the admin page, never inside the canvas, and far too big to inject there. |
| 18 |
// Same precedent as modules/post-import-feedback's `-style` entry. |
| 19 |
'block-patterns': path.resolve(__dirname, 'assets/scss/style.scss'), |
| 20 |
}, |
| 21 |
}; |
| 22 |
|