Back to the front. Bootstrap with composer

After a long while I had to something with frontend coding. I wanted to used composer like in my PHP projects. But how the heck to get the composer files to the public / frontend folder on each update? Luckily composer knows a post update command. So here we go

{
  "require": {
    "twbs/bootstrap": "4.3.1"
  },
  "scripts": {
    "post-update-cmd": [
      "rm -rf public/bootstrap",
      "cp -R vendor/twbs/bootstrap/dist public/bootstrap"
    ]
  }
}

with composer update the files will be copied to public/bootstrap. Easy!

Leave a Reply

Your email address will not be published. Required fields are marked *