I am trying to import the .css from full-calendar package.
First, I created a new component my-calendar (html, scss, ts).
Then, I tried 3 different ways but only the last one worked for me:
Reference the file directly, as the documentation suggested, in the index.html (it does not work because the reference to node_modules is lost when you build the project)
<link href="node_modules/fullcalendar/dist/fullcalendar.min.css" rel="stylesheet">
Adding
@import "~fullcalendar/dist/fullcalendar.min.css";
in my-calendar.scss. If I am not wrong, this should add the style into main.css when the project is being built (is not working)Create custom copy config (copy.config.js)
module.exports = { ... copyFullCalendar: { src: ['{{ROOT}}/node_modules/fullcalendar/dist/fullcalendar.min.css'], dest: '{{BUILD}}' } }
and adding
@import "fullcalendar.min.css"
; into my-calendar.scss
UPDATE:
and adding @import "fullcalendar";
into my-calendar.scss
to avoid compiler errors when use ionic build --aot --minifycss --minifyjs
I would appreciate if someone could clarify the best way and explain if I misunderstood some concept.
PS: Remember that I am working with Ionic3 and I am not using the Angular CLI.