6👍
✅
From DefinePlugin 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 either alternate quotes, such as
'"production"'
, or by usingJSON.stringify('production')
.
So, change your code to:
new webpack.DefinePlugin({
'process.env': {
loginEmail: "'xxxxx'",
loginPw: "'xxxxxx'"
}
})
or
new webpack.DefinePlugin({
'process.env': {
loginEmail: JSON.stringify("xxxxx"),
loginPw: JSON.stringify("xxxxxx")
}
})
Source:stackexchange.com