try with env setting alternative
This commit is contained in:
@@ -22,16 +22,14 @@ module.exports = {
|
||||
net: false,
|
||||
};
|
||||
|
||||
// Turn { KEY: "value" } into { "process.env.KEY": JSON.stringify("value") }
|
||||
const env = {
|
||||
myDummyKey: 'myDummyPAT',
|
||||
};
|
||||
const envKeys = Object.keys(env).reduce((prev, next) => {
|
||||
prev[`process.env.${next}`] = JSON.stringify(env[next]);
|
||||
return prev;
|
||||
}, {});
|
||||
webpackConfig.plugins.push(new webpack.DefinePlugin(envKeys));
|
||||
|
||||
// Inject process.env so server code can access PAT_1
|
||||
webpackConfig.plugins.push(
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': {
|
||||
myDummyKey: JSON.stringify('myDummyPAT'), // <-- your env var
|
||||
},
|
||||
}),
|
||||
);
|
||||
return webpackConfig;
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user