If you use a CDN for your SPFx 1.12 projects, you might have noticed that when you build your SPFx package and try to deploy it to Azure no files are getting copied. You might see something similar when you try to run gulp deploy-azure-storage even though it worked fine in SPFx 1.11.
Build target: DEBUG [16:23:27] Using gulpfile ~/Projects/SPFx/SPFx1.12WebPart/gulpfile.js [16:23:27] Starting 'deploy-azure-storage'... [16:23:27] Starting gulp [16:23:27] Starting subtask 'configure-sp-build-rig'... [16:23:27] Finished subtask 'configure-sp-build-rig' after 3.06 ms [16:23:27] Starting subtask 'deploy-azure-storage'... [16:23:27] [deploy-azure-storage] Uploading files '**/*.*' from directory './temp/deploy/' to Azure [16:23:27] [deploy-azure-storage] Created container: azurehosted-webpart [16:23:27] [deploy-azure-storage] Uploading 0 files to Azure... [16:23:27] [deploy-azure-storage] Upload complete! [16:23:27] [deploy-azure-storage] Access your files at: https://spfxcdntest.blob.core.windows.net/azurehosted-webpart [16:23:27] Finished subtask 'deploy-azure-storage' after 364 ms
This appears to be an issue in the build chain where the files from release/assets are not being copied to the folder temp/deploy. You can work around this easily enough by making sure the temp/deploy folder exists and that it’s empty. Now after you run gulp build –prod. You simply need to copy the files from release/assets into temp/deploy. Now run gulp deploy-azure-storage and your files will be deployed to Azure.
If you have an Azure DevOps build pipeline that is affected by the issue, you can add a CopyFiles task before your deploy command.
- task: CopyFiles@2 displayName: 'SPFx 1.12 - Copy Files to: temp/deploy' inputs: Contents: | $(Build.SourcesDirectory)/release/assets/* TargetFolder: '$(Build.SourcesDirectory)/temp/deploy'
This is just a workaround for now. Track GitHub issue #6847, if you want to follow its progress.