Hi,
I'm experimenting with PCF controls. Great stuff!
I've made a colorful autocomplete control with values from an optionset (just to try it out). You can see here what's about. https://dianabirkelbach.wordpress.com/2019/05/21/pcf-control-colorful-autocomplete-optionset/
I've tried to include font-awesome in my css subdirectory, by defining the resources in my manifest like that:
<resources> <code path="index.ts" order="1"/> <css path="css/BirDiaAutocomplete.css" order="1" /> <css path="css/font-awesome.css" order="1" /> <css path="css/fontawesome/fontawesome_webfont.eot" order="2" /> <css path="css/fontawesome/fontawesome_webfont.svg" order="2" /> <css path="css/fontawesome/fontawesome_webfont.ttf" order="2" /> <css path="css/fontawesome/fontawesome_webfont.woff" order="2" /> <css path="css/fontawesome/fontawesome_webfont.woff2" order="2" /> </resources>
Inside the font-awesome.css, I have some links , referencing the resources in the subdirectory.
@font-face { font-family: 'FontAwesome'; src: url("fontawesome/fontawesome_webfont.eot?"); src: url("fontawesome/fontawesome_webfont.eot?#iefix") format("embedded-opentype"), url("fontawesome/fontawesome_webfont.woff2?") format("woff2"), url("fontawesome/fontawesome_webfont.woff?") format("woff"), url("fontawesome/fontawesome_webfont.ttf?") format("truetype"), url("fontawesome/fontawesome_webfont.svg?#fontawesomeregular") format("svg"); font-weight: normal; font-style: normal; }
That didn't work!
But it did work when font-awesome.css was inside the same subdirectory as the referenced resources, having the links in the same folder (because it seems that the subfolder structure is flattened up, without any subfolder)
@font-face { font-family: 'FontAwesome'; src: url("fontawesome_webfont.eot?"); src: url("fontawesome_webfont.eot?#iefix") format("embedded-opentype"), url("fontawesome_webfont.woff2?") format("woff2"), url("fontawesome_webfont.woff?") format("woff"), url("fontawesome_webfont.ttf?") format("truetype"), url("fontawesome_webfont.svg?#fontawesomeregular") format("svg"); font-weight: normal; font-style: normal; }
I quess this will apply to images too.
My question is:
Is it recommended/allowed to make subfolders when making the control? Do we have to be aware that the path of the resources doesn't have any subfolders? Or maybe there is a plan to change this behaviour?
Best regards,
Diana
Hi Diana,
Currently, the build tool will output all control resource files flattened into the output folder. We are aware that this causes issues when these files are referenced via relative paths within other resource files. To address this, we have planned a future update that will preserve the subfolder structure for control resources in the output folder.
Thank you,
Alex