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 * After the next require you can use process.env to get your secrets
*/ */
...@@ -16,12 +17,13 @@ console.log({ ...@@ -16,12 +17,13 @@ console.log({
*/ */
module.exports = { module.exports = {
webpack: config => { webpack: config => {
config.plugins.forEach(plugin => { config.plugins.push(
if (plugin.constructor.name === 'DefinePlugin') { new webpack.DefinePlugin({
plugin.definitions['process.env.SECRET'] = JSON.stringify(process.env.SECRET) 'process.env.SECRET': JSON.stringify(process.env.SECRET)
} })
}) // Same as above
// new webpack.EnvironmentPlugin(['SECRET'])
)
return config 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