Gutenberg dependencies in package.json

Yes and no, it depends…

The WP Scripts package depends on the @wordpress/dependency-extraction-webpack-plugin package at:

https://github.com/WordPress/gutenberg/tree/master/packages/dependency-extraction-webpack-plugin

What this will do is search for packages from @wordpress and list them in a file to make it easy for you to load the list of dependencies when enqueuing. It also adjusts webpack so that it knows not to compile in those dependencies, but instead rely on WordPress to provide them at runtime via enqueuing. As a result, the packages aren’t needed, and you don’t end up with 20 copies of @wordpress/element loaded on the page from every extra block installed.

So, you don’t need to put @wordpress/element in your package.json requirements when using wp scripts to build the assets. This only applies to WordPress packages though. Other libraries on the other hand get included the normal way.