- 安装开发环境
-
#可以在一行中安装以下所有三个工具:Gulp、Yeomam、Yeoman SharePoint 生成器 npm install gulp yo @microsoft/generator-sharepoint --global #信任自签名开发人员证书 gulp trust-dev-cert #要获取所有全局安装包的列表,请运行以下命令 npm list --global --depth=0️
- 新建spfx项目
-
md helloworld-webpart cd helloworld-webpart yo @microsoft/sharepoint
- 初始化项目
-
yarn #或者: npm install #创建项目报错,不能运行 yarn --force
- 运行
-
gulp serve
- 项目生成捆绑
-
gulp bundle gulp bundle --ship
- 生成解决方案包sppkg
-
gulp package-solution gulp package-solution --ship
- SPO开启CND
-
Connect-SPOService https://m365xxx-admin.sharepoint.com Get-SPOTenantCdnEnabled -CdnType public #如果是False,则继续执行 Set-SPOTenantCdnEnabled -CdnType public
- debug页面
-
#debug https://localhost:4321/temp/workbench.html #绑定站点debug: /_layouts/15/workbench.aspx
spfx solution常用命令
最新推荐文章于 2024-08-10 16:46:58 发布