LoginSignup
0

More than 5 years have passed since last update.

TravisCIでデプロイする際、bowerでインストールされるファイル群から不要なものを削除する

Last updated at Posted at 2018-01-27

bowerを使うと、パッケージによっては本番環境には不要なものもインストールされることがある(ReadMeなど)。
使わないものをデプロイするのは無駄なので、それらを除外するようTravisCIの設定を変更した。

例)jqueryのdistフォルダのみを残し、不要なファイル/フォルダを削除する
.travis.ymlにbefore_deployブロックとして追記(languageはbash)。

before_script:
  - npm install -g bower
  - bower install
before_deploy:
  - find wwwroot/lib/jquery -maxdepth 1 -type f | xargs rm -rf
  - rm -rf wwwroot/lib/jquery/src
  - rm -rf wwwroot/lib/jquery/external

もっとシンプルな書き方がありそう。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0