Custom script tag in index.html is removed on each build in Ionic 2 RC.0


#1

Hi there, I’m rebuilding my Ionic 2 app to work in the RC.0 and I’m having an issue with Charts.js. I’m using the ng2-chartjs2 module which works well, but it also needs the Charts.js 2.0 library also included in the index.html. I can easily add it in a script tag in index.html - and it works - but on every build it disappears. I presume this is because rollup is re-writing the index.html file on each build and removing the script tag.

How can I get around this? Do I need to configure the rollup build stage to include the Chart.js library? If so, how do I achieve this?

Thanks in advance,
Phil


#2

For anyone else who has this issue - the fix was to simply edit the index.html in src/index.html, the run the build process again. It’s then copied to www/index.html


#3

I put the custom in the index.html in src/index.html and ran the build process again. But it did not copy to www/index.html.


#4

@ianpinto_vamaship Try to delete the www folder before running the build process.