I've downloaded select2 as node module by:
npm install select2
and included it in my app.js:
require('select2')($);
When I run
webpack there are no errors, but when I open the app I get:
Uncaught TypeError: Object.defineProperty called on non-object(…)
coming from select2.js:
S2.define('select2/core',[
'jquery',
'./options',
'./utils',
'./keys'
], function ($, Options, Utils, KEYS) {
(...)
}
Does it happen because module wrapper for select2 works only with AMD and is incompatible with CommonJS?