|
@@ -4,7 +4,7 @@
|
|
|
</h2>
|
|
|
|
|
|
<p>
|
|
|
- Yes, Select2 should work with most AMD or CommonJS loaders without any issues.
|
|
|
+ Select2 should work with most AMD- or CommonJS-compliant module loaders, including <a href="http://requirejs.org/">RequireJS</a> and <a href="https://github.com/jrburke/almond">almond</a>. Select2 ships with a modified version of the <a href="https://github.com/umdjs/umd/blob/f208d385768ed30cd0025d5415997075345cd1c0/templates/jqueryPlugin.js">UMD jQuery template</a> that supports both CommonJS and AMD environments.
|
|
|
</p>
|
|
|
|
|
|
<h3>
|
|
@@ -29,10 +29,18 @@ $.fn.select2.defaults.set('amdLanguageBase', 'select2/i18n/');
|
|
|
</h3>
|
|
|
|
|
|
<p>
|
|
|
- Due to a bug in older versions of the r.js build tool, Select2 was sometimes placed before jQuery in then compiled build file. Because of this, Select2 will trigger an error because it won't be able to find or load jQuery.
|
|
|
+ Due to <a href="https://github.com/jrburke/requirejs/issues/1342">a bug in older versions</a> of the r.js build tool, Select2 was sometimes placed before jQuery in then compiled build file. Because of this, Select2 will trigger an error because it won't be able to find or load jQuery.
|
|
|
</p>
|
|
|
|
|
|
<p>
|
|
|
- You can fix this issue by upgrading to a newer version of the r.js build tool.
|
|
|
+ By upgrading to version 2.1.18 or higher of the r.js build tool, you will be able to fix the issue.
|
|
|
+ </p>
|
|
|
+
|
|
|
+ <h3>
|
|
|
+ Should I point to the files in <code>dist</code> or <code>src</code>?
|
|
|
+ </h3>
|
|
|
+
|
|
|
+ <p>
|
|
|
+ Select2 internally uses AMD and the r.js build tool to build the files located in the <code>dist</code> folder. These are built using the files in the <code>src</code> folder, so <em>you can</em> just point your modules to the Select2 source and load in <code>jquery.select2</code> or <code>select2/core</code> when you want to use Select2. The files located in the <code>dist</code> folder are also AMD-compatible, so you can point to that file if you want to load in all of the default Select2 modules.
|
|
|
</p>
|
|
|
</section>
|