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

HOTT-4301 set NODE_OPTIONS for webpack compilation #584

Merged
merged 1 commit into from
Nov 6, 2023

Conversation

jebw
Copy link
Contributor

@jebw jebw commented Nov 3, 2023

Jira link

HOTT-4301

What?

I have added/removed/altered:

  • Set the required NODE_OPTIONS env var to allow Webpack 4 to work with OpenSSL 3

Why?

I am doing this because:

  • Webpacker requires webpack v4
  • Webpack v4 needs MD4
  • OpenSSL 3 hides MD4 behind a config option
  • Setting it via .env files works for specs but not for dynamic compilation via rails s or via rails webpacker:compile - because the env files are loaded during app initialization and the app is seems not to be initialized for the webpacker process

Deployment risks (optional)

  • None, only affects bin/webpack binary

The NODE_OPTIONS env var is necessary to make webpack 4 (needed by webpacker) work in OpenSSL 3

Setting it via `.env.development` doesn't work because because that is only loaded during application initialisation which doesn't happen during `rails webpacker:compile`

Instead I've inserted it into the `bin/webpack` binstub used by webpacker
@jebw jebw merged commit df77507 into main Nov 6, 2023
3 checks passed
@jebw jebw deleted the HOTT-4301-fix-webpack branch November 6, 2023 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants