Skip to content

Commit

Permalink
add webpack define plugin to inject environment variables during comp…
Browse files Browse the repository at this point in the history
…ilation time
  • Loading branch information
EC2 Default User committed Nov 8, 2017
1 parent 1777041 commit 2cbbfdb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const webpack = require('webpack');

module.exports = {
exportPathMap() {
return {
Expand All @@ -8,4 +10,11 @@ module.exports = {
'/view-questionnaire': { page: '/view-questionnaire' },
};
},
webpack: (cfg) => {
cfg.plugins.push(new webpack.DefinePlugin({
'process.env.REACT_APP_API_BASE_URL': JSON.stringify(process.env.REACT_APP_API_BASE_URL),
}));

return cfg;
},
};

0 comments on commit 2cbbfdb

Please sign in to comment.