docs icon indicating copy to clipboard operation
docs copied to clipboard

Instructions for usage with Webpack

Open gricey432 opened this issue 6 years ago • 1 comments

Migrating in from https://github.com/select2/select2/issues/5372

Select2 doesn't work out of the box with Webpack and additional steps are needed. The linked ticket has some suggestions.

This ticket should come up with the minimum steps needed to make Select2 compatible and then document them.

gricey432 avatar Aug 23 '19 03:08 gricey432

It was extreme pain to pack latest Select2(4.0.10) with transtions throught Webpack because of minimal information on the internet and in the documentation.

This example code should work for users that use Symfony Webpack Encore: const $ = require('jquery'); require('select2'); const Slovak = require('select2/src/js/select2/i18n/sk');

$.fn.select2.defaults.set('debug', true); // This will help you debug problem with translations $.fn.select2.defaults.set('language', Slovak); $('form').select2()

BPavol avatar Sep 05 '19 12:09 BPavol