Closed Carlosps closed 5 years ago
Can you share your repository on Github? I could take a look...
As I am using it on an Ionic project with Angular 5 version, there is no angular.json file or equivalent.
Not sure where I should place the style and scripts.
Hi @Carlosps,
Your project doesn't have an angular.json
file because you use Ionic v3 which is not compatible with Angular 6. I would suggest you to start a project with the new Ionic v4 which comes with an angular.json
file and will ease the integration of 3rd party library like this one (and benefit from all the optimizations done with Angular 6 release or, even better, freshly released Angular 7).
I am not a expert with Ionic but from what I've read if you want to stick with Ionic v3 you would have to add a copy.config.js
script to copy external libraries to the build folder. You can look at this blog for the how to: https://zerone-consulting.blog/2017/10/10/steps-to-include-custom-cssjs-files-in-ionic-3/
Does it answer your question correctly?
Following the link I gave you, I've added the copy.config.js
file to your repository which contains the scripts that must be copied to your build
folder when serving the application (I've included both JQuery and MalihuCustomScrollbar dependencies to the script).
I've submitted a PR to your repository.
Closing the issue as it is not related to the library but on how to integrate a third-party library to Ionic 3 and I've submitted a PR to your repository to fix your issue.
Hello,
Once I do include the
"types": [ "jquery", "mcustomscrollbar" ],
I get[app-scripts] [10:15:52] typescript error [app-scripts] Cannot find type definition file for 'jquery'. [app-scripts] Cannot find type definition file for 'mcustomscrollbar'. [app-scripts] [10:15:52] typescript error
in my logs.Also, when I do open the browser I get the
Refused to apply style from 'http://localhost:8100/build/main.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
Any ideas how to solve this?