-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from skooch/master
Added build frontend script for Windows
- Loading branch information
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#requires -version 2 | ||
<# | ||
.SYNOPSIS | ||
Windows build script for mixlab | ||
.PARAMETER Release | ||
Builds in release mode | ||
.EXAMPLE | ||
Build-Frontend -Release | ||
#> | ||
|
||
Param( | ||
[Parameter( | ||
HelpMessage="Build in release mode")] | ||
[switch] | ||
$Release | ||
) | ||
|
||
Set-Location -Path (Join-Path -Path (Get-Location) -ChildPath "frontend") | ||
|
||
if ($Release) { | ||
$BuildMode = "--release" | ||
} else { | ||
$BuildMode = "--dev" | ||
} | ||
|
||
$env:RUSTFLAGS = "--remap-path-prefix src=frontend/src" | ||
|
||
if ($null -eq (Get-Command "wasm-pack.exe" -ErrorAction SilentlyContinue)) | ||
{ | ||
Write-Host "wasm-pack is not installed... please install it from https://rustwasm.github.io/wasm-pack/installer/" | ||
} | ||
|
||
wasm-pack.exe build "$BuildMode" --target no-modules |