-
Notifications
You must be signed in to change notification settings - Fork 8
/
make.ps1
42 lines (35 loc) · 1.31 KB
/
make.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<#
Webpart build, bundle and ship
This will build the Vue app into the assets folder within the webpart, then update the webpart to reference it for rendering.
Run from PowerShell in the root app folder (not the webpart sub-folder)
./make
#>
function Log {
param (
$Message
)
Write-Host $Message -ForegroundColor yellow -BackgroundColor black
Write-Host " "
}
Log "Webpart build, bundle and ship:"
Log "REMINDER: update version in package.json before running this script because that will become the version of the webpart package."
Log "Building webpart..."
npm run build
Remove-Item webpart/src/webparts/assets/fonts -Recurse -Force -ErrorAction Ignore
Remove-Item webpart/src/webparts/assets/mock-data -Recurse -Force -ErrorAction Ignore
Remove-Item webpart/src/webparts/assets/*.ico -ErrorAction Ignore
Remove-Item webpart/src/webparts/assets/*.html -ErrorAction Ignore
Remove-Item webpart/src/webparts/assets/*.css -ErrorAction Ignore
Log "Bundling assets..."
$programPath = "node_scripts\bundle-webpart-assets.js"
$cmd = "node"
$params = @($programPath)
& $cmd $params
Log "Packaging for shipping to SharePoint..."
cd webpart
gulp clean
gulp bundle --ship
gulp package-solution --ship
cd ..
Log "DONE."
Log "Webpart package for uploading to App Catalog is in: webpart/sharepoint/solution/"