1
0
mirror of synced 2024-11-22 13:06:08 +03:00

Relative paths for require

Now we can use relative paths in the calls to `require`, so those
using relative builds don't have to worry about modules not being
imported properly. This also makes it considerably easier in the
future when we look to cut down the build sizes and have a custom
builder, as we don't have to worry as much about the paths being
incorrect.

This fixes https://github.com/select2/select2/issues/3014 finally.
This commit is contained in:
Kevin Brown 2015-03-14 19:22:34 -04:00
parent d1e8a6fdad
commit 7e4e8bc9d6
5 changed files with 21 additions and 11 deletions

View File

@ -4200,6 +4200,7 @@ S2.define('select2/i18n/en',[],function () {
S2.define('select2/defaults',[
'jquery',
'require',
'./results',
'./selection/single',
@ -4232,7 +4233,9 @@ S2.define('select2/defaults',[
'./dropdown/closeOnSelect',
'./i18n/en'
], function ($, ResultsList,
], function ($, require,
ResultsList,
SingleSelection, MultipleSelection, Placeholder, AllowClear,
SelectionSearch, EventRelay,
@ -4515,8 +4518,8 @@ S2.define('select2/defaults',[
}
this.defaults = {
amdBase: 'select2/',
amdLanguageBase: 'select2/i18n/',
amdBase: './',
amdLanguageBase: './i18n/',
closeOnSelect: true,
debug: false,
escapeMarkup: Utils.escapeMarkup,

File diff suppressed because one or more lines are too long

9
dist/js/select2.js vendored
View File

@ -4200,6 +4200,7 @@ S2.define('select2/i18n/en',[],function () {
S2.define('select2/defaults',[
'jquery',
'require',
'./results',
'./selection/single',
@ -4232,7 +4233,9 @@ S2.define('select2/defaults',[
'./dropdown/closeOnSelect',
'./i18n/en'
], function ($, ResultsList,
], function ($, require,
ResultsList,
SingleSelection, MultipleSelection, Placeholder, AllowClear,
SelectionSearch, EventRelay,
@ -4515,8 +4518,8 @@ S2.define('select2/defaults',[
}
this.defaults = {
amdBase: 'select2/',
amdLanguageBase: 'select2/i18n/',
amdBase: './',
amdLanguageBase: './i18n/',
closeOnSelect: true,
debug: false,
escapeMarkup: Utils.escapeMarkup,

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,7 @@
define([
'jquery',
'require',
'./results',
'./selection/single',
@ -32,7 +34,9 @@ define([
'./dropdown/closeOnSelect',
'./i18n/en'
], function ($, ResultsList,
], function ($, require,
ResultsList,
SingleSelection, MultipleSelection, Placeholder, AllowClear,
SelectionSearch, EventRelay,
@ -315,8 +319,8 @@ define([
}
this.defaults = {
amdBase: 'select2/',
amdLanguageBase: 'select2/i18n/',
amdBase: './',
amdLanguageBase: './i18n/',
closeOnSelect: true,
debug: false,
escapeMarkup: Utils.escapeMarkup,