Package to include compatibility javascript


#1

I am trying to write a package right now that needs to add some legacy javascript library that used to work by putting it into the client/compatibility folder.

How do I specify in the package.js file that a particular asset needs to be in compatibility mode?


#2

Excellent question. I’m running into this problem this evening as well. Did you ever figure this out? Anybody else know how to do this?


#3

Never got an answer, nor figured it out, unfortunately.


#4

Looking at the code, using

api.addFiles('bootstrap3-wysihtml5.all.js', 'client',{bare: true});

should work, but it does not. This very same file fails when using in a package this way, but succeeds when adding to client/compatibility folder of the app.

Doesn’t anybody know how to include a 3rd party file in a package?


#5

Maybe api.export helps to export the variable of your 3rd party library.


#6

This is a jQuery extension. When the library is loaded, the function is there, but something inside the code hasn’t initialized properly. My suspicion that {bare: true} is not working is in the fact that when the library is in the client/compatibility folder it shows up in the list of resources in the browser, but when I api_add it, it shows up wrapped inside .js of my package.


#7

turns out the file I was loading had multiple libraries included, not just the jQuery extension. I was able to hack the include on make it work.

Bottom line however, {bare: true} is not the same as client/compatibility folder.

So the question remains.