Expand Minimize

SPF229801: Project doesn't exclude standard dependencies

Project doesn't exclude standard dependencies that are provided with the SharePoint Framework from the generated bundles

CheckId SPF229801
TypeName ProjectExcludesStandardDependencies
Severity CriticalWarning
Type ProjectConfig

SharePoint Framework project should exclude all standard dependencies that are provided together with the SharePoint Framework from the generated bundles. This is done by including the standard dependencies in the externals section of the config\config.json file.

config\config.json example

{
  "entries": [
    {
      "entry": "./lib/webparts/weather/WeatherWebPart.js",
      "manifest": "./src/webparts/weather/WeatherWebPart.manifest.json",
      "outputPath": "./dist/weather.bundle.js"
    }
  ],
  "externals": {
   "@microsoft/sp-client-base": "node_modules/@microsoft/sp-client-base/dist/sp-client-base.js",
    "@microsoft/sp-client-preview": "node_modules/@microsoft/sp-client-preview/dist/sp-client-preview.js",
    "@microsoft/sp-lodash-subset": "node_modules/@microsoft/sp-lodash-subset/dist/sp-lodash-subset.js",
    "office-ui-fabric-react": "node_modules/office-ui-fabric-react/dist/office-ui-fabric-react.js",
    "react": "node_modules/react/dist/react.min.js",
    "react-dom": "node_modules/react-dom/dist/react-dom.min.js",
    "react-dom/server": "node_modules/react-dom/dist/react-dom-server.min.js"

  },
  "localizedResources": {
    "mystrings": "webparts/weather/loc/{locale}.js"
  }
}

Disclaimer: The views and opinions expressed in this documentation and in SPCAF do not necessarily reflect the opinions and recommendations of Microsoft or any member of Microsoft. SPCAF and RENCORE are registered trademarks of Rencore. All other trademarks, service marks, collective marks, copyrights, registered names, and marks used or cited by this documentation are the property of their respective owners.