admin管理员组文章数量:1122846
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?
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?
Share Improve this question asked Apr 16, 2024 at 17:04 Moussa SaidiMoussa Saidi 113 bronze badges 1 |1 Answer
Reset to default 1For some reason npm run plugin-zip
only ZIP the build file and that's not enough for a plugin.
I created my ZIP file manually by moving the build folder and index.php to a new folder and zip them. And that fixed the issue.
本文标签: How can I use the zip of my plugin in another website
版权声明:本文标题:How can I use the zip of my plugin in another website? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736309974a1934212.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
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. – Tony Djukic Commented Apr 24, 2024 at 19:14