I am using LWC oss framework to play with lightning-base-components npm package. I have used 'salesforce-ux/design-system' to use SLDS.I could use base components as lightning web components with SLDS. But problem here is, SLDS Icons are not rendering on the app. I have imported salesforce-ux/design-system css file in the public/index.html file but icons are not cmoing up on ui though they are present in public/assets folder. As I am new to opensource web application frameworks, I am not able to figure out if I am missing any..
html code:
<p id="action" class="slds-box slds-text-heading_small">Action icons represent actions a user can take. The default
size of action icons are larger than the others. <br /><br />
<lightning-icon icon-name="action:approval" alternative-text="Approved" title="Approved"></lightning-icon>
<lightning-icon icon-name="action:delete" alternative-text="Delete" title="Delete"></lightning-icon>
<lightning-icon icon-name="action:new_note" alternative-text="New note" title="New note"></lightning-icon>
<lightning-icon icon-name="action:preview" alternative-text="Preview" title="Preview"></lightning-icon>
</p>
Output where icons are missing.
public/index.html
<link
rel="stylesheet"
href="assets/styles/salesforce-lightning-design-system.min.css"
/>
express server.js
app.get("*", (req, res) => {
return res.sendFile(path.resolve(__dirname, "../public/index.html"));
});
app.listen(port, () =>
console.log(`Example app listening at http://localhost:${port}`)
);
(async () => {
const watcher = await rollup.watch(config);
watcher.on('event', (event) => {
if (event.code === 'START') {
console.log('Compiling...');
}
if (event.code === "END") {
console.log('Done!');
}
});
})();