Skip to content

Commit

Permalink
fix for webpack 2 DefinePlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
gconaty committed Feb 14, 2017
1 parent a99b570 commit 9769cbe
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/server/config/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,18 @@ export function loadEnv(options = {}) {
.forEach((name) => {
env[name] = process.env[name];
});

return {
'process.env': JSON.stringify(env),
};

if (webpackVersion == 2) {
Object.keys(env).forEach((name) => {
env[name] = JSON.stringify(env[name])
})
return {
'process.env': env
}
}
else {
return {
'process.env': JSON.stringify(env),
};
}
}

0 comments on commit 9769cbe

Please sign in to comment.