部署精简 Chrome 扩展程序的更好方法
部署扩展时,我遵循各种步骤:将所有文件复制到临时文件夹,将代码来回复制/粘贴到在线压缩器/混淆器,然后创建要上传的 zip。
显然,这可以通过脚本来简化,但我在 Windows 脚本方面的经验非常有限(我的大部分经验都是服务器端的)。我是否必须像 90 年代那样回顾 DOS .bat 文件,或者是否有一些我不知道的很酷的工具或方法?
When deploying an extension I follow various steps : copy to a temporary folder all the files, copy/paste back and forth the code to the on-line minifiers / obfuscators and create the zip to be uploaded.
It's obvious that this could be simplified with scripting, but my experience on Windows scripting is very limited (most of my experience is server-side). Do I have to look back to the DOS .bat files like in the 90's or is there some cool tool or method I'm not aware?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
除了 Ant 之类的东西之外,PHP 也非常适合 CLI 脚本,即使在 Windows 上也是如此。大量内置功能,包括 .zip 创建,以及完整的文档。
在我看来,学习 PHP(或 Python,或其他任何东西)比批处理脚本更好。
Besides something like Ant, PHP is great for CLI scripting, even on Windows. Tons of built-in functions, including .zip creation, and thorough docs.
IMO you'd be better off learning PHP (or Python, or anything else) than batch scripting.
我正在使用 Apache Ant 进行构建。也许有点矫枉过正,但你可以自动化一切 - 缩小(使用第 3 方 java 库)、存档、缩小后自动插入许可证头。
如果您不熟悉 Ant(或 java),那么可能很难直接跳入其中。
附言。这是我的开源扩展,它使用 Ant 进行构建,你可以查看它(它将文件复制到构建文件夹中,缩小,存档)
I am using Apache Ant for builds. Maybe an overkill, but you can automate everything - minification (with 3rd party java libs), archiving, automatic license header insertion after minification.
I you are not familiar with Ant (or java) then it will be probably hard to jump right into it.
PS. Here is my open souce extension that uses Ant for builds, you can check it out (it copies files into a build folder, minifies, archives)