I'm trying to use lightslider (jquery slider library) from NPM in my Aurelia CLI 0.23.0 project.
I have added this to the aurelia.json dependencies:
{
"name": "lightslider",
"path": "../node_modules/lightslider/dist",
"main": "js/lightslider.min",
"deps": ["jquery"],
"resources": [
"css/lightslider.min.css"
]
},
added this to my home.html template :
<require from="lightslider/css/lightslider.min.css"></require>
and in home.ts i've added these :
import * as $ from 'jquery';
import lightSlider from 'lightslider';
--
attached() {
$(document).ready(function(){
$("#light-slider").lightSlider();
});
}
The library also has img/controls.png which if i add the the aurelia.json dependencies under resources like this :
{
"name": "lightslider",
"path": "../node_modules/lightslider/dist",
"main": "js/lightslider.min",
"deps": ["jquery"],
"resources": [
"css/lightslider.min.css",
"img/controls.png"
]
},
it returns error as it looks for img/controls.js.
therefor I have added the lightslider/img/controls.png in the root directory and it works fine, but is there any correct way to be able to skip this step and it doesn't requires me to add the image resource to the root directory manually?
I have found simillar discussion related to Font-awesome in this post for the font resources but i couldn't find the proper solution to be able to apply it in my case.
Thanks in advance.