ux
ux copied to clipboard
Not imports ux-icons
import * as icons from '@aurelia-ux/icons/sets/full-array.min.json'; aurelia.use.plugin(PLATFORM.moduleName('@aurelia-ux/icons'), { icons })
This is my main.ts. I ran the instructions found in https://aurelia.io/blog/2020/03/02/aurelia-release-notes-march-2020/
Could anyone help me? Do I need to import anything into webpack?
Hi @DanieleRosada thanks for reaching here.
What you did is right. Are you using typescript ? Did you also follow the instruction regarding the tsconfig.json
on the blog ?
Basically it says:
Importing JSON
Note for TypeScript users: Make sure that your tsconfig.json is set to allow importing JSON files. This can be achieved by setting "resolveJsonModule": true in the compilerOptions section.
If this doesn't solve your problem, could you give us more details regarding your situation ?
- are you using typescript ?
- any error or warning in the console ?
Alternative solution:
I have faced a situation once where even with the resolveJsonModule: true
in tsconfig.json
the icons would not load properly. I realized that even though the module would import, it would not be imported as expected. To fix this I did this in the main.ts
:
.plugin(PLATFORM.moduleName('@aurelia-ux/icons'), {icons: (icons as any).default})
If this is also your case please let me know as I would like to investigate a little more and see if we can find a better solution.
.plugin(PLATFORM.moduleName('@aurelia-ux/icons'), {icons: (icons as any).default})
With this it works, thank you!
I use typescript and I had no errors and no warnings,
except this warning that's left in the visual studio code console:
WARNING in @aurelia-ux/core Multiple versions of @aurelia-ux/core found: 0.18.1 ./~/@aurelia-ux\core 0.19.0 ./~/@aurelia-ux\icons/~/@aurelia-ux\core