node.js - Heroku, NodeJs App, Gulp, and asset revisioning issues -
i running issue asset revisioning when pushing nodejs app heroku.
i planning on running gulp production task in post-install. 1 of tasks involves revisioning files (app.js -> app.6789.js). means have clean references files in index.ejs. problem heroku's ephemeral filesystem (where no files written visible processes in other dyno , files written discarded moment dyno stopped or restarted). since run after files have been written there big chance rev lost.
one thought compile locally , push reved index.ejs, @ least images there twice since compress them etc , increases slug size...
am missing asset revisioning / node / gulp / heroku? can't seem find solution or instance of happening else makes me believe setting wrong, true. help!!
i'm node.js platform owner @ heroku.
heroku splits deploys 'build' , 'run' phases... when git push
app, can use package.json postinstall
script build whatever assets you'd like, stored in 'slug'. files in slug used dynos spun afterwards.
where no files written visible processes in other dyno , files written discarded moment dyno stopped or restarted
i think may what's tripping up. build runs on single, special, temporary dyno - , file system creates used in subsequent, long-lasting dynos. can safely build assets in postinstall
used across multiple dynos , restarts.
lots more info here: