-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Usable wasm browser apps build output with WasmBundlerFriendlyBootConfig=true #125192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
2512418
3b65b19
2f96dcb
34fa937
f809af2
43d8563
862aeb3
d01a074
23435bc
ffef895
db997e1
9d455f8
dc1b9ec
558f778
f2764ef
18c7d4f
a6c0da2
dab4b6b
ba4e664
247615c
1c1f5b5
ba717c2
0ce730c
4d63607
faf2368
ecd01f0
badc32e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,9 +20,9 @@ namespace Wasm.Build.Tests; | |
|
|
||
| public class WasmTemplateTestsBase : BuildTestBase | ||
| { | ||
| private readonly WasmSdkBasedProjectProvider _provider; | ||
| private readonly string _extraBuildArgsBuild = "-p:WasmEnableHotReload=false"; | ||
| private readonly string _extraBuildArgsPublish = "-p:CompressionEnabled=false -p:WasmEnableHotReload=false"; | ||
| private readonly WasmSdkBasedProjectProvider _provider; | ||
| protected readonly PublishOptions _defaultPublishOptions; | ||
| protected readonly BuildOptions _defaultBuildOptions; | ||
| protected const string DefaultRuntimeAssetsRelativePath = "./_framework/"; | ||
|
|
@@ -119,8 +119,6 @@ protected ProjectInfo CopyTestAsset( | |
| extraProperties += | ||
| """ | ||
| <WasmBundlerFriendlyBootConfig>true</WasmBundlerFriendlyBootConfig> | ||
| <WasmFingerprintAssets>false</WasmFingerprintAssets> | ||
| <CompressionEnabled>false</CompressionEnabled> | ||
| """; | ||
| } | ||
|
|
||
|
|
@@ -190,9 +188,10 @@ public virtual (string projectDir, string buildOutput) PublishProject( | |
| public virtual (string projectDir, string buildOutput) BuildProject( | ||
| ProjectInfo info, | ||
| Configuration configuration, | ||
| bool noDefaultOptions = false, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need to omit default options?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because by default it sets WasmEnableHotReload=false, this is to demonstrate it works without that as default option. |
||
| bool? isNativeBuild = null, | ||
| bool? wasmFingerprintDotnetJs = null) => // null for unset properties | ||
| BuildProjectCore(info, configuration, _defaultBuildOptions, isNativeBuild, wasmFingerprintDotnetJs); | ||
| BuildProjectCore(info, configuration, noDefaultOptions ? new BuildOptions() : _defaultBuildOptions, isNativeBuild, wasmFingerprintDotnetJs); | ||
|
|
||
| public virtual (string projectDir, string buildOutput) BuildProject( | ||
| ProjectInfo info, | ||
|
|
@@ -242,9 +241,9 @@ public virtual (string projectDir, string buildOutput) BuildProject( | |
| return (_projectDir, res.Output); | ||
| } | ||
|
|
||
| if (EnvironmentVariables.UseJavascriptBundler && buildOptions.IsPublish) | ||
| if (EnvironmentVariables.UseJavascriptBundler) | ||
| { | ||
| string publicWwwrootDir = Path.GetFullPath(Path.Combine(GetBinFrameworkDir(configuration, forPublish: true), "..")); | ||
| string publicWwwrootDir = Path.GetFullPath(Path.Combine(GetBinFrameworkDir(configuration, forPublish: buildOptions.IsPublish), "..")); | ||
| File.Copy(Path.Combine(BuildEnvironment.TestAssetsPath, "JavascriptBundlers", "package.json"), Path.Combine(publicWwwrootDir, "package.json")); | ||
| File.Copy(Path.Combine(BuildEnvironment.TestAssetsPath, "JavascriptBundlers", "rollup.config.mjs"), Path.Combine(publicWwwrootDir, "rollup.config.mjs")); | ||
|
|
||
|
|
@@ -485,6 +484,9 @@ void OnErrorMessage(string msg) | |
| } | ||
| } | ||
|
|
||
| public string GetBootConfigPath(string binFrameworkDir, string? bootConfigFileName = null) => | ||
| _provider.GetBootConfigPath(binFrameworkDir, bootConfigFileName); | ||
|
|
||
| public string GetBinFrameworkDir(Configuration config, bool forPublish, string? framework = null, string? projectDir = null) => | ||
| _provider.GetBinFrameworkDir(config, forPublish, framework ?? DefaultTargetFramework, projectDir); | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.