Commit b43af823 authored by Luis Fernando Alvarez D's avatar Luis Fernando Alvarez D Committed by Tim Neutkens

Updated example with-now-env (#4081)

* New example: with-now-env

* updated the example with-now-env
parent 7e671522
const webpack = require('webpack')
/**
* After the next require you can use process.env to get your secrets
*/
......@@ -16,12 +17,13 @@ console.log({
*/
module.exports = {
webpack: config => {
config.plugins.forEach(plugin => {
if (plugin.constructor.name === 'DefinePlugin') {
plugin.definitions['process.env.SECRET'] = JSON.stringify(process.env.SECRET)
}
})
config.plugins.push(
new webpack.DefinePlugin({
'process.env.SECRET': JSON.stringify(process.env.SECRET)
})
// Same as above
// new webpack.EnvironmentPlugin(['SECRET'])
)
return config
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment