Skip to content

Instantly share code, notes, and snippets.


Øyvind Saltvik fivethreeo

View GitHub Profile
fivethreeo / razzle-plugin-node-runtime-vars.js
Last active Jan 10, 2021 — forked from mattlubner/razzle-plugin-node-runtime-vars.js
Razzle plugin to force certain environment variables to be resolved dynamically at runtime for the nodejs bundle
View razzle-plugin-node-runtime-vars.js
* The passed list of environment variables will be removed from the nodejs
* instance of webpack.DefinePlugin, so they can be resolved dynamically at
* runtime.
* @example
* // Include this in the plugins array exported by razzle.config.js
* const nodeRuntimeVarsPlugin = createRazzlePluginNodeRuntimeVars('PORT', 'HOST');
* @param {String} ...nodeRuntimeVars
* @return {Function}