Combine _attachment files as a preprocessing step in a couchapp
-
29-10-2019 - |
Question
I have a couchapp with the following structure in the _attachments
directory:
_attachments/
|-- code
| |-- model.js
| |-- primary.js
| |-- router.js
| `-- view.js
|-- index.html
`-- style
`-- main.css
When I run couchapp push
, I want all the files in _attachments/code
(or any arbitrary directory within _attachments
) to be combined into a single file that I can reference in _attachments/code/index.html
. It would be helpful to specify an order of files within a directory.
There is a couchapp hook available to compress files, but I don't see an easy way to combine them, especially since that may mean outputting some intermediate file, ensuring the original files don't get uploaded, and cleaning up.
Is a hook to combine files the best way, and if so, how would you recommend it work?
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow