[GH-ISSUE #409] How to use flag-icon-css with Ionic 3? #250

Closed
opened 2026-03-03 14:35:49 +03:00 by kerem · 2 comments
Owner

Originally created by @juanqui66 on GitHub (Nov 12, 2017).
Original GitHub issue: https://github.com/lipis/flag-icons/issues/409

I'm starting with Ionic 3 and I need to use country flags and coins and I wanted to use flag-icon-css, but I do not know how to do it. I added the dependency with:

npm install --save flag-icon-css

... but now I do not know how to continue. I have reviewed the issue # 193 but then there was no ionic 2/3. Any ideas?

Thanks in advance.

Originally created by @juanqui66 on GitHub (Nov 12, 2017). Original GitHub issue: https://github.com/lipis/flag-icons/issues/409 I'm starting with Ionic 3 and I need to use country flags and coins and I wanted to use flag-icon-css, but I do not know how to do it. I added the dependency with: npm install --save flag-icon-css ... but now I do not know how to continue. I have reviewed the issue # 193 but then there was no ionic 2/3. Any ideas? Thanks in advance.
kerem closed this issue 2026-03-03 14:35:49 +03:00
Author
Owner

@tomlutzenberger commented on GitHub (Nov 12, 2017):

I recommend to look at Ionic's documentation first:
https://ionicframework.com/docs/developer-resources/third-party-libs/

Google "use css library with ionic 3" => 2. result

<!-- gh-comment-id:343769362 --> @tomlutzenberger commented on GitHub (Nov 12, 2017): I recommend to look at Ionic's documentation first: https://ionicframework.com/docs/developer-resources/third-party-libs/ Google "use css library with ionic 3" => 2. result
Author
Owner

@juanqui66 commented on GitHub (Nov 13, 2017):

Finally I have achieved it with the following steps (besides installing your module):

  1. Edit the file ./node_modules/[at]ionic/app-scripts/config/copy.config.js of our project (creating the file ./config/copy.config.js has not worked for me). We add the following lines at the end of it:

   copyFlagIconCss: {
     src: ['{{ROOT}}/node_modules/flag-icon-css/css/'],
     dest: '{{BUILD}}'
   },
   copyFlagIconFlagsCss: {
     src: ['{{ROOT}}/node_modules/flag-icon-css/flags/**/
'],
     dest: '{{WWW}}/flags/'

  1. Edit the file ./src/index.html to add:

  

The problem was in which copy.config.js to use and the second line added in this file, that in no forum had seen that it was necessary to use.

Thank you and excuse my bad English.

<!-- gh-comment-id:343875061 --> @juanqui66 commented on GitHub (Nov 13, 2017): Finally I have achieved it with the following steps (besides installing your module): 1. Edit the file ./node_modules/[at]ionic/app-scripts/config/copy.config.js of our project (creating the file ./config/copy.config.js has not worked for me). We add the following lines at the end of it:    copyFlagIconCss: {      src: ['{{ROOT}}/node_modules/flag-icon-css/css/*'],      dest: '{{BUILD}}'    },    copyFlagIconFlagsCss: {      src: ['{{ROOT}}/node_modules/flag-icon-css/flags/**/*'],      dest: '{{WWW}}/flags/' 2. Edit the file ./src/index.html to add:    <link href = "build/flag-icon.min.css" rel = "stylesheet"> The problem was in which copy.config.js to use and the second line added in this file, that in no forum had seen that it was necessary to use. Thank you and excuse my bad English.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/flag-icons#250
No description provided.