Ignore folders in .couchappignore
题
My CouchApp has the following folder structur, where files inside the app folder are compiled into the _attachments
folder:
my_couchapp
├── _attachments/
│ ├── app.js
│ ├── app-tests.js
│ └── index.html
├── app/
│ └── app.js
├── Assetfile
└── views/
I want to exclude the file Assetfile
, _attachments/app-tests.js
and the folder app
.
My current .couchappignore
looks like this:
[
"app",
"Assetfile",
"_attachments/app-tests.js"
]
But this doesn't seem to work. All files beginning with app
inside the _attachments
folder are not pushed.
How do I define folders and specific files to be excluded when the CouchApp is pushed via couchapp push
?
解决方案
After a little more experimentation I found a way: the app
folder can be excluded by specifying app$
, so the final .couchappignore
now looks like this:
[
"app$",
"Assetfile",
"app-tests.js"
]
其他提示
In case you arrived here looking for a way to ignore subfolders, you are just like me. Here's my problem:
my-couchapp/
├── node_modules/
│ ├── react.js
│ ├── url/
│ ├── browserify/
│ └── coffee-script/
├── app/
│ └── app.js
└── views/
I wanted to include node_modules/react.js
and node_modules/url/
(and all subfolders), but didn't want to include node_modules/browserify/
and node_modules/coffeescript
.
I was trying
[
"node_modules/browserify$",
"node_modules/coffee-script$"
]
but it wasn't working.
[
"node_modules\/browserify",
"node_modules\/coffee-script"
]
also didn't work.
The only thing that worked was
[
"browserify",
"coffee-script"
]
I don't know why.