Skip to content

Commit ccd652c

Browse files
yyx990803frandiox
authored andcommitted
prevent webpack from injecting useless mocks
1 parent f80deff commit ccd652c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

template/build/webpack.base.conf.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,17 @@ module.exports = {
7979
}
8080
}
8181
]
82+
},
83+
node: {
84+
// prevent webpack from injecting useless setImmediate polyfill because Vue
85+
// source contains it (although only uses it if it's native).
86+
setImmediate: false,
87+
// prevent webpack from injecting mocks to Node native modules
88+
// that does not make sense for the client
89+
dgram: 'empty',
90+
fs: 'empty',
91+
net: 'empty',
92+
tls: 'empty',
93+
child_process: 'empty'
8294
}
8395
}

0 commit comments

Comments
 (0)