Skip to content

Commit

Permalink
chore: check for existing arr
Browse files Browse the repository at this point in the history
  • Loading branch information
evenstensberg committed Oct 2, 2019
1 parent 673daf8 commit b46efe6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/groups/advanced.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,13 @@ class AdvancedGroup extends GroupHelper {
resolveOptions() {
const { args } = this;
if (args.hot) {
const HotModuleReplacementPlugin = require('webpack').HotModuleReplacementPlugin;
this.opts.options.plugins = [new HotModuleReplacementPlugin()];
const { HotModuleReplacementPlugin } = require('webpack');
const hotModuleVal = new HotModuleReplacementPlugin();
if (this.opts.options && this.opts.options.plugins) {
this.opts.options.plugins.unshift(hotModuleVal);
} else {
this.opts.options.plugins = [hotModuleVal];
}
}
if (args.prefetch) {
const { PrefetchPlugin } = require('webpack');
Expand Down

0 comments on commit b46efe6

Please sign in to comment.