GithubHelp home page GithubHelp logo

marketertechnologies / heroku-buildpack-post-build-clean Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lostmyname/heroku-buildpack-post-build-clean

0.0 0.0 0.0 4 KB

Buildpack to remove unwanted files from the slug post-build

License: MIT License

Shell 100.00%

heroku-buildpack-post-build-clean's Introduction

Post-build Clean Buildpack

A simple buildpack to run after all other buildpacks have completed, which removes a set of files defined in .slug-post-clean, so that they are not included in the finished slug.

Rationale

While this may seem to duplicate functionality provided by Heroku's .slugignore, there is a key difference: .slugignore'd files are removed after the repo is cloned, but before any buildpack is run. They can therefore not be involved in the build process itself.

However, it is not uncommon for there to exist files in the repo that are necessary for the build, but are not required at runtime. There may also be installable build dependencies that are not runtime dependencies.

In our case, a complex front-end build involves significant CSS, JS and image assets, along with a large installation of node modules, all of which are used only for building the production assets, but then remain part of the slug.

Usage

You will need to use the heroku-buildpack-multi buildpack, and add your existing buildpack(s) to the .buildpacks file in your application repository. The post-build-clean buildpack must be last in the buildpack order:

# .buildpacks
https://github.com/heroku/heroku-buildpack-nodejs
https://github.com/heroku/heroku-buildpack-ruby
https://github.com/Lostmyname/heroku-buildpack-post-build-clean

The .slug-post-clean file supports single-file and single-directory declarations only, e.g.:

some_huge_file.psd
some/nested/directory
why_does_this_app_even_contain_a.tiff

I might expand it to support file globs, but for the moment it's not necessary and the testing implications give me the willies.

heroku-buildpack-post-build-clean's People

Contributors

urbanautomaton avatar mcmillan avatar moravcik avatar nruth avatar vladstoick avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.