Only set webpack mode to production if NODE_ENV or RAILS_ENV matches
Only set webpack mode to production if NODE_ENV or RAILS_ENV matches

This avoids webpack mode errors on e.g. RAILS_ENV=test which is an
invalid value for webpack.

jgraichen/mnemosyne-server,jgraichen/mnemosyne-server,jgraichen/mnemosyne-server