packery icon indicating copy to clipboard operation
packery copied to clipboard

Build process with gulp and and main-bower-files

Open daviestar opened this issue 9 years ago • 4 comments

Hi metafizzy,

It's maybe worth mentioning in the docs that if you are using the main-bower-files gulp plugin to add this to your bower.json:

"overrides": {
    "packery": {
      "main": "dist/packery.pkgd.js",
      "dependencies": {}
    }
}

Took me quite a while to figure that out.

daviestar avatar Jun 01 '15 12:06 daviestar

Thanks for reporting this issue.

On the Bower side, main should not be used for compiled files or distribution files. We're looking to resolve adding a field for files to include with files. See bower/bower.json-spec#47.

desandro avatar Jun 24 '15 17:06 desandro

Huh, didn't realise that.

So I guess that means the main-bower-files plugin is has the wrong idea about bower too.

I've been using it for ages and rarely come across issues.. most major plugins (jQuery, Lo-dash, etc.) seem to use main for their un-minified distribution file(s), so it does seem like a convention of sorts.

daviestar avatar Jun 24 '15 17:06 daviestar

I believe a better solution is to point to the 4 .js files

"overrides": {
  "packery": {
    "main": [
      "js/rect.js",
      "js/packer.js",
      "js/item.js",
      "js/packery.js"
    ]
  }
}

This way you can have individual files all up the dependency tree, and concat them if necessary.

desandro avatar Jun 24 '15 17:06 desandro

One downside to this, is if you decide to change your structure then the override will need to be changed too. I'll use this though, thanks for your help :+1:

daviestar avatar Jun 24 '15 18:06 daviestar