Created
September 25, 2019 14:01
-
-
Save matheus1lva/921fa1da9c73bbab883d968661265ccb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
... | |
plugins: [ | |
new webpack.DefinePlugin({ | |
__DEV__: JSON.stringify(process.MY_ENV_VARIABLE) | |
}), | |
] | |
} |
From webpack docs:
Note that because the plugin does a direct text replacement, the value given to it must include actual quotes inside of the string itself. Typically, this is done either with alternate quotes, such as '"production"', or by using JSON.stringify('production').
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
why JSON.stringify?