Skip to content

Commit

Permalink
only build vendor bundle if vendor entry points are given
Browse files Browse the repository at this point in the history
  • Loading branch information
kommander committed May 18, 2017
1 parent 6720419 commit fcc3f89
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions attitudes/vendor/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ VendorPlugin.prototype.apply = function apply(compiler) {
secondPass = true;
return true;
}
return;
return undefined;
});
});

Expand All @@ -38,7 +38,13 @@ VendorPlugin.prototype.apply = function apply(compiler) {
const uniqueRequests = _.uniq(userRequests)
.filter((req) => req.match(/node_modules/))
.filter((req) => !req.match(/node_modules\/(webpack|querystring|ansi-html|html-entities|css-loader|ieee754|isarray|base64|ansi-regex|buffer|strip-ansi)/));
console.log(require('util').inspect(uniqueRequests));

if (uniqueRequests.length === 0) {
this.built = true;
done(null);
return;
}

const manifestPath = path.join(this.dist, 'vendor-manifest.json');
const dllPlugin = new webpack.DllPlugin({
context: this.context,
Expand Down

0 comments on commit fcc3f89

Please sign in to comment.