Skip to content
This repository has been archived by the owner on Mar 31, 2020. It is now read-only.

Allow to add external references to browserify stream #305

Merged
merged 1 commit into from
Nov 2, 2015
Merged

Allow to add external references to browserify stream #305

merged 1 commit into from
Nov 2, 2015

Conversation

josescgar
Copy link
Contributor

Allow to specify which libraries should not be included in browserify builds so they can be provided externally, i.e.: vendor.js.

JeffreyWay added a commit that referenced this pull request Nov 2, 2015
Allow to add external references to browserify stream
@JeffreyWay JeffreyWay merged commit 11cbc12 into laravel:master Nov 2, 2015
@jonjrodriguez
Copy link

I was just about to submit a pull request for this functionality using options instead of something on the browserify config object. With this method, how would you build the vendor.js?

With it as an option, it works like below.

mix.browserify('main.js', null, null, {require: ['jquery'])
   .browserify('second.js', null, null, {external: ['jquery']);

With it on the config object, how would you build vendor.js or main.js? The below wouldn't work

elixir.config.js.browserify.externals = ['jquery'];

mix.browserify('main.js', null, null, {require: ['jquery']); // jquery not included here
mix.browserify('second.js');

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants