目前我有 Typescript 模块,其中包含 ./src
目录
还有travic-ci
language: node_js
node_js:
- 5.1.0
install:
- npm install
- npm install -g mocha
- npm install -g gulp
- npm install -g tsd
- tsd rate
- tsd install
script: gulp
after_success: npm test
deploy:
provider: npm
email: secret
api_key:
secure: secret
Gulp 任务在“./build”目录中生成文件
问题是当它尝试部署时
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# build/
#
nothing added to commit but untracked files present (use "git add" to track)
所以它迫使我在本地构建项目并将其添加到 github,并使使用 travis-ci 成为无用的步骤
最佳答案
刚刚通过以下步骤解决了此问题:
1:将./build
目录添加到.gitignore
文件
build
typings
test/**/*.js
test/**/*.map
2:创建.npmignore
以省略.gitignore
规则(我还将.src
目录放入其中)
src
test
typings
关于javascript - travis-ci 构建和部署 npm 模块时如何包含 "build"目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33975935/