Tuesday, May 21, 2024
 Popular · Latest · Hot · Upcoming
129
rated 0 times [  133] [ 4]  / answers: 1 / hits: 12571  / 11 Years ago, tue, january 21, 2014, 12:00:00

Hi I'm using the grunt browserify task to setup my code, I have shimmed in jQuery and I'm now trying to include jquery.tablesorter.



Can jquery plugins be used with browserify in this way?



shim: {
jquery: {
path: 'lib/bower/jquery/jquery.js',
exports: '$'
},
'jquery.tablesorter': {
path: 'lib/bower/jquery.tablesorter/js/jquery.tablesorter.js',
exports: 'tablesorter',
depends: {
jquery: '$',
}
}
}

More From » jquery

 Answers
1

You may try by doing this:



shim: {
jquery: {
path: 'lib/bower/jquery/jquery.js',
exports: '$'
},
'jquery.tablesorter': {
path: 'lib/bower/jquery.tablesorter/js/jquery.tablesorter.js',
exports: null,
depends: {
jquery: '$',
}
}
}


If the above is not working, you can try this:



shim: {
jquery: {
path: 'lib/bower/jquery/jquery.js',
exports: null
},
'jquery.tablesorter': {
path: 'lib/bower/jquery.tablesorter/js/jquery.tablesorter.js',
exports: null,
depends: {
jquery: 'jQuery',
}
}
}

[#48483] Monday, January 20, 2014, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
milor

Total Points: 284
Total Questions: 93
Total Answers: 115

Location: Venezuela
Member since Thu, Jul 15, 2021
3 Years ago
;