简体   繁体   中英

How to zip 'dist' folder as final build step of ember-cli application

Is there an easy way to zip the dist folder as part of my ember build?

ember build --build=production

Are there some hooks that I can use?

I use a prod_build.sh file and just run that.

$> ./prod_build.sh

the script just calls ember b --environment=production and zips up the final build contents zip -r <my_folder>

This used to be something that could be handled in a simple addon using the postBuild hook. However, the point at which this hook is called was recently changed so that it fires before everything is copied into dist. It's understandable that some may need this behaviour but it screws anyone who was relying on the files being in dist already when postBuild is called. I opened an issue about it here but it doesn't appear to have much movement.

Meanwhile, I do as @anschoewe suggests and use a shell script which calls ember itself, then tends to my postBuild needs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM