Skip to content

Commit

Permalink
Allow mix.extract() before mix.js() calls - closes #224
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffreyWay committed Jan 30, 2017
1 parent 108f0a9 commit 89af7a6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion setup/webpack.config.js
Expand Up @@ -306,7 +306,7 @@ if (Mix.copy) {
}


if (Mix.js.vendor) {
if (Mix.extract) {
module.exports.plugins.push(
new webpack.optimize.CommonsChunkPlugin({
names: [Mix.js.base + '/vendor', Mix.js.base + '/' + 'manifest'],
Expand Down
4 changes: 2 additions & 2 deletions src/WebpackEntry.js
Expand Up @@ -98,12 +98,12 @@ class WebpackEntry {
* Add any relevant vendor extractions to the entry.
*/
addVendors() {
if (! this.mix.js.length || ! this.mix.js.vendor) return this;
if (! this.mix.js.length || ! this.mix.extract) return this;

let vendorPath = (this.mix.js.base + '/vendor')
.replace(this.mix.publicPath, '');

this.entry.add(vendorPath, this.mix.js.vendor);
this.entry.add(vendorPath, this.mix.extract);

return this;
}
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Expand Up @@ -39,7 +39,7 @@ module.exports.js = (entry, output) => {
* @param {array} libs
*/
module.exports.extract = (libs) => {
Mix.js.vendor = libs;
Mix.extract = libs;

return this;
};
Expand Down

0 comments on commit 89af7a6

Please sign in to comment.