LoginSignup
3
2

More than 5 years have passed since last update.

npmライブラリを書くときのtravisの設定

Last updated at Posted at 2018-01-11

だいたい以下のようなtravis.ymlを書けばいいです。

language: node_js
node_js:
  - '8'
  - '6'

cache:
  yarn: true
  directories:
    - ".eslintcache"
    - "node_modules"

notifications:
  email: false

yarn

基本的にyarnを使います。
before_installを使ってインストールします。
デフォルトでサポートしているようです。yarn.lockがあれば自動的にyarnが使用されます。なおbefore_installyarnをインストールしていてもCIの実行時間的には差はありません。

notifications

notificationsは完全にスパムになるのでfalseにした方がいいと思います。

node_js

node_js:
  - '8'
  - '6'

の部分ですが、babel環境なら8だけ書いておけばいいです。また、個人にはnode4系はサポートする必要はもうないと思います。

touch-altを使っていれば、一度touch -a .travis.ymlすると今後はtouch .travis.ymlで上記のテンプレートが作られるので便利です。

3
2
0

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
3
2