Ionic2 add local CSS


#1

Hi there,

for my leafletjs project I have to link to
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.0.2/dist/leaflet.css" />
in the index.html file.

However, I installed the module with

npm install leaflet --save

and the CSS is in the local dir

project/node_modules/leaflet/dist/leaflet.css

. How to reference the local one instead of the remote and making sure it will be added to the build? Sorry, I’m new to ionic2.


#2

Ionic 2 projects use the Ionic App Scripts. You can override the copy config file to copy that leaflet.css from node_modules to the output folder during the build, and include it as a relative path in your index.html.