Closed tuananh closed 6 years ago
Hey, ya, that's the tricky part with mutable config objects.
You have to change as little as possible. I have another response to this example here: https://github.com/lukeed/pwa/issues/28#issuecomment-418539968
In your example, which is very similar, you should write into keys directly instead of overwriting the whole config.resolve
object.
module.exports = function (config) {
// Right
config.resolve.alias.newAlias = 'hello';
// Wrong
config.resolve.alias = {
newAlias: 'hello'
}
Lemme know if that helps 👍
Thank you. It works.
I'm not sure if this is the expected behavior.
take preact for example, there are a bunch of default
resolve.alias
for webpack. as soon as i add more alias, the other default, required aliases were gone, leavingpwa build
to fail.i have to copy them and add to my override config to make it work.