I created a new plugin for a WordPress project using @wordpress/scripts in my local environment.
After I finished and ran the command npm run plugin-zip
it generated the zip file but couldn't be installed on the production, saying:
"The package could not be installed. No valid plugins were found."
The problem is the node_modules folder is so big, and zipping the full plugin and uploading it doesn't feel correct to me. How can I move only the built folder of the plugin to the production site?
node_modules
in the theme and then went even further by dropping their own scripts into sub-directories within... ..makes updating things a nightmare. You should be able to structure your 'build' so that it outputs the finished, compiled plugin into it's own separate folder, so the none of the node.js modules need to be included.