Open eltiare opened 7 years ago
Environment variables are supposed to work: https://github.com/Shopify/sprockets-commoner/blob/master/test/env_test.rb
How do you make the env variables work?
I run the server with env NODE_ENV=development rails s
and my js file has:
console.log('process.env', process.env);
but it throws Uncaught ReferenceError: process is not defined
error. Should I do something more to make this env variable available?
It won't work if you do process.env
, but process.env.NODE_ENV
should get replaced with the correct environment variable.
I get this error message when running my app in production mode:
application-c40ae74….js:2 Warning: It looks like you're using a minified copy of the development build of React. When deploying React apps to production, make sure to use the production build which skips development warnings and is faster. See https://fb.me/react-minification for more details.
The link suggests setting the environment variable NODE_ENV=production for some other preprocessors, but that doesn't seem to work with sprockets-commoner.