Skip to main content

With LWC OSS on Node, we could have lwc-services.config.js something like this :

module.exports = {

resources: [

{ from: 'src/resources/', to: 'dist/resources/' },

{ from: 'node_modules/@salesforce-ux/design-system/assets', to: 'dist/SLDS'}

]

};

 

which copied SLDS assets to dist at build time.

Then index.html included a link to the SLDS CSS :

  <link rel="stylesheet" type="text/css" href="SLDS/styles/salesforce-lightning-design-system.css" />

 

How should we do this in an LWR app ?

2 件の回答
  1. 2022年3月3日 14:20

    So building off Keijis post I was able to set an asset in the lwr.config.json file and then add to my layouts index.html. This may not be the official way to do this but I was able to get it to work :)  

    lwr.config.json asset

    {

    "alias": "sldsDir",

    "dir": "$rootDir/node_modules/@salesforce-ux/design-system/assets",

    "urlPath": "/slds"

    }

     index.html

    <link

    rel="stylesheet"

    href="$sldsDir/styles/salesforce-lightning-design-system.min.css"

    />

0/9000