Skip to content

Commit b46efe6

Browse files
committed
chore: check for existing arr
1 parent 673daf8 commit b46efe6

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/groups/advanced.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,13 @@ class AdvancedGroup extends GroupHelper {
4343
resolveOptions() {
4444
const { args } = this;
4545
if (args.hot) {
46-
const HotModuleReplacementPlugin = require('webpack').HotModuleReplacementPlugin;
47-
this.opts.options.plugins = [new HotModuleReplacementPlugin()];
46+
const { HotModuleReplacementPlugin } = require('webpack');
47+
const hotModuleVal = new HotModuleReplacementPlugin();
48+
if (this.opts.options && this.opts.options.plugins) {
49+
this.opts.options.plugins.unshift(hotModuleVal);
50+
} else {
51+
this.opts.options.plugins = [hotModuleVal];
52+
}
4853
}
4954
if (args.prefetch) {
5055
const { PrefetchPlugin } = require('webpack');

0 commit comments

Comments
 (0)