bobbingwide / uk-tides

UK tides - heights and times
https://www.oik-plugins.com/oik-plugins/uk-tides-times-and-heights/
1 stars 1 forks source link

Update wp-scripts and test with WordPress 6.6.2 #29

Open bobbingwide opened 1 day ago

bobbingwide commented 1 day ago

UK-tides blocks is currently delivered with one entry point /build/index.js. wp-scripts has been improved considerably. It now supports multiple blocks per plugin. UK tides doesn't need multiple blocks... but I may be moving the JavaScript source to another plugin that performs the build. So I need to build it the same way as other blocks which do have multiple entry points.

Requirement

Process

For plugins which have already been changed refer to the code changes in

bobbingwide commented 1 day ago

Interestingly, since UK-tides only had one entry point, the build worked without having to create a webpack.config.js file. But when I moved block.json from the plugin's root directory the build failed with the same messages I got for other plugins.

uk-tides@3.2.1 dev wp-scripts start

Skipping "./build/index.js" listed in "C:/apache/htdocs/wordpress/wp-content/plugins/uk-tides/src/oik-uk-tides/block.json". File does not exist in the "src" directory. [webpack-cli] TypeError: Cannot convert undefined or null to object at Function.keys () at getNormalizedEntryStatic (C:\apache\htdocs\wordpress\wp-content\plugins\uk-tides\node_modules\webpack\lib\config\normalization.js:491:27) at process.processTicksAndRejections (node:internal/process/task_queues:95:5)