Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
thedarkside opened this issue Aug 9, 2024 · 0 comments

Comments

@thedarkside
Copy link

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 :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant