Should I version control the minified versions of my jQuery plugins?

前端 未结 3 948
遇见更好的自我
遇见更好的自我 2020-12-31 12:30

Let\'s say I write a jQuery plugin and add it to my repository (Mercurial in my case). It\'s a single file, say jquery.plugin.js. I\'m using BitBucket to manage

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-31 13:15

    Here are the Sensible Rules for Repositories™ that I use for myself:

    1. If a blob needs to be distributed as part of the source package in order to build it, use it, or test it from within the source tree, it should be under version control.
    2. If an asset can be regenerated on demand from versioned sources, do that instead. If you can (GNU) make it, (Ruby) rake it, or just plain fake it, don't commit it to your repository.
    3. You can split the difference with versioned symlinks, maintenance scripts, submodules, externals definitions, and so forth, but the results are generally unsatisfactory and error prone. Use them when you have to, and avoid them when you can.

    This is definitely a situation where your mileage may vary, but the three Sensible Rules work well for me.

提交回复
热议问题