I've been attempting to incorporate select2 into my project without success.
Every time I try these two methods, I always receive an error saying $('#state').select2
is not a function. However, when I include select2 in a standard <script>
tag, everything functions correctly.
require('./bootstrap');
import 'select2';
$('#state').select2({
minimumResultsForSearch: -1
});
and
require('./bootstrap');
window.select2 = require('select2/dist/js/select2.min.js');
$('#state').select2({
minimumResultsForSearch: -1
});