Skip to content

Commit

Permalink
Merge pull request #6 from skooch/master
Browse files Browse the repository at this point in the history
Added build frontend script for Windows
  • Loading branch information
Charlie Somerville committed Apr 3, 2020
2 parents 1036eeb + 289d3d4 commit 584e3ee
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions Build-Frontend.ps1
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

0 comments on commit 584e3ee

Please sign in to comment.