SPFX软件包始终引用本地主机而不是CDN的内容或资源

问题描述 投票:0回答:1

When I tried to deploy the package in sharepoint everytime it refers to the localhost resources

有人可以从哪里更改此配置,以便我应该从CDN路径而不是localhost引用它。]

下面是我的package-solution.json

{
  "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json",
  "solution": {
    "name": "mega-menu-sp-fx-client-side-solution",
    "id": "8f49d75c-5a49-4657-b81b-0290f239350f",
    "version": "10.0.0.0",
    "includeClientSideAssets": true,
    "skipFeatureDeployment": true,
    "isDomainIsolated": false,
    "features": [
      {
        "title": "Application Extension - Deployment of custom action.",
        "description": "Deploys a custom action with ClientSideComponentId association",
        "id": "0d2345df-2a49-4ce9-ba2d-bee7ad3e7a02",
        "version": "10.0.0.0",
        "assets": {
          "elementManifests": [
            "elements.xml",
            "clientsideinstance.xml"
          ]
        }
      }
    ]
  },
  "paths": {
    "zippedPackage": "solution/mega-menu-sp-fx.sppkg"
  }
}

下面是我的write-manifest.json

{
  "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/write-manifests.schema.json",
  "cdnBasePath": "https://Mytenant.sharepoint.com/sites/MyTechTheme/MenuFiles"
}

有人可以让我知道从哪里可以更改此配置,以便它应从CDN路径而不是localhost引用。下面是我的package-solution.json {“ $ schema”:“ https:// ...] >

sharepoint-online spfx spfx-extension
1个回答
0
投票

要从CDN或SharePoint库加载SPFx资产,请将'includeClientSideAsserts'值设置为false。

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.