Reputation: 661
What is the best way to include two variables for a single package that is required in JavaScript?
I have an example here:
$ = require('jquery');
At the moment I simply use $
however some of my project uses jQuery
which I cannot change.
$, jQuery = require('jquery');
However this did not work which was expected to be honest.
This works however it isn't ideal as it will be requiring the package twice wont it?
$ = require('jquery');
jQuery = require('jquery');
Thanks
Upvotes: 1
Views: 95