Skip to content

Defaulting NODE_ENV=development leads to not minified assets during build #757

@thedarkside

Description

@thedarkside

Iam using the rails buildpack which integrates rails-assets and therefor yarn-install.

Since an upgrade i observed that the compiled assets in the resulting image are not minified anymore. The reason is that shakapacker (webpacker) uses NODE_ENV to decide whether the assets should be minified for production or just build for development (including some dependencies which are only relevant for development like vue-devtools).

In the build log i observe that the node buildpack which runs prior to yarn-install sets NODE_ENV=production. Then comes yarn-install setting it to development and installs all dependencies. After that rails-assets buildpack is run which picks up NODE_ENV=development and compiles the assets for development instead of production.

Expected Behavior

Assets should be minified and built for production use in the container image

Current Behavior

Assets are being build not minified into the container image

Possible Solution

Dont know :(

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions