gjaldon / heroku-buildpack-phoenix-static

A Heroku buildpack for building Phoenix's static assets
MIT License
229 stars 224 forks source link

support multi phoenix umbrella apps #117

Open andrejj opened 3 years ago

andrejj commented 3 years ago

Support multi phoenix umbrella apps.

Made it possible to build assets for multiple phoenix apps inside an umbrella. Removed some phoenix and dirs auto detection. Made the compile script more explicit but easier to customize. Removed support for older phoenix versions. Implemented caching per umbrella app.

andrejj commented 3 years ago

I opened this PR by mistake. It's WIP on our end to support building assets for an umbrella app with more than one phoenix app. Fell free to close or let me know if you'd be interested in using some of the approaches here.

Gist - compile script that builds two apps:

# app_root/compile

# Build first phoenix app
phoenix_dir=$build_dir/apps/first_app_web
assets_dir=$build_dir/assets
info "Phoenix dir ${phoenix_dir}"

cd $assets_dir
install_and_cache_node_modules
npm run deploy
remove_assets_node_modules

cd $phoenix_dir
mix "phx.digest"
mix "phx.digest.clean"

# Build second phoenix app
phoenix_dir=$build_dir/apps/second_app_web
assets_dir=$build_dir/assets
info "Phoenix dir ${phoenix_dir}"

cd $assets_dir
install_and_cache_node_modules
npm run deploy
remove_assets_node_modules

cd $phoenix_dir
mix "phx.digest"
mix "phx.digest.clean"
peaceful-james commented 3 years ago

@jesseshieh Would this work with Gigalixir?