Reputation: 463
I'm new to aurelia and trying to add JQuery Popup Overlay to my Aurelia CLI v 0.23.0 project (typescript). This library is not available in NPM. can anyone guide me on what is the proper way to use it in my project and add it aurelia.json.
What if the library got CSS and image resources as well.
unfortunately i couldn't find any proper structured and clean way to do it, or a tutorial or documentation. in here there is a documentation but that's for the client libraries which are available on npm. appreciate you guidance.
Upvotes: 2
Views: 141
Reputation: 11990
In your aurelia.json you can add libraries that come from anywhere. Since your library is not in NPM, you will have to copy its folder to your project folder, and then add the instruction in the aurelia.json. For example:
{
"name": "JQueryPopup",
"path": "../JQueryPopup", //<--- folder path
"main": "jquery-popup", //<--- filename without .js
"resources": [
"file1.css", //<-- css resources
"file2.css"
]
}
However, sometimes the best way to handle legacy libraries is adding <script>
and <link>
tags to your index.html. I think this would be the best option considering that this library is not even in NPM.
Upvotes: 1