diff --git a/.travis.yml b/.travis.yml
index 0e04596ec8631dd65a791f5038739a8ceb440912..04a7dc23b66932fc55111dba45c28c92c8ff1b9b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -6,9 +6,6 @@ language: node_js
 node_js:
   - "7.6.0"
 
-env:
-  - NODE_ENV=production
-
 services:
   - mongodb
   - redis-server
@@ -17,7 +14,7 @@ before_script:
   - mkdir ./.config
   - cp ./.ci-files/default.yml ./.config
   - cp ./.ci-files/test.yml ./.config
-  - npm run build
+  - NODE_ENV=production && npm run build
 
 after_success:
   - openssl aes-256-cbc -K $encrypted_ceda82069128_key -iv $encrypted_ceda82069128_iv -in .travis_rsa.enc -out .travis_rsa -d