Pass environment variables to app with dotenv and custom variables
npm install -D @rambler-tech/razzle-environment
or
yarn add -D @rambler-tech/razzle-environment
Add the plugin to razzle.config.js
const EnvironmentPlugin = require('@rambler-tech/razzle-environment')
const VERSION = '...'
module.exports = {
plugins: [
EnvironmentPlugin({
VERSION
})
],
modifyWebpackConfig({webpackConfig}) {
// ...
return webpackConfig
}
}