Thefrank / dotnet-freebsd-crossbuild

Bash script and patches for building dotNET for FreeBSD under Linux
31 stars 3 forks source link

aspnetcore patch: disabling optimization hints in webpack.config.js #3

Open spchamp opened 2 years ago

spchamp commented 2 years ago

This update to the patchset for dotnet/aspnetcore may serve to address the following build error, under tests.

  TestContentPackage -> /usr/local/src/dotsys_wk/crossbuild/build/aspnetcore/artifacts/bin/TestContentPackage/Release/net6.0/TestContentPackage.dll
  [3/4] Linking dependencies...
  [4/4] Building fresh packages...
  Done in 37.15s.
  yarn run v1.22.10
  $ node node_modules/webpack-cli/bin/cli.js --mode production --config ./webpack.config.js

  Duplicate Sources / Packages - No duplicates found. 🚀

  asset AuthenticationService.js 282 KiB [emitted] [minimized] [big] (name: AuthenticationService) 1 related asset

[sic]

/usr/local/src/dotsys_wk/crossbuild/build/aspnetcore/src/Components/WebAssembly/WebAssembly.Authentication/src/Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj(67,5): error :
in asset size limit: The following asset(s) exceed the recommended size limit (120 KiB).
  This can impact web performance.
  Assets:
    AuthenticationService.js (282 KiB)

/usr/local/src/dotsys_wk/crossbuild/build/aspnetcore/src/Components/WebAssembly/WebAssembly.Authentication/src/Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj(67,5): error : in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
  Entrypoints:
    AuthenticationService (282 KiB)
        AuthenticationService.js

/usr/local/src/dotsys_wk/crossbuild/build/aspnetcore/src/Components/WebAssembly/WebAssembly.Authentication/src/Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj(67,5): error : in webpack performance recommendations:
  You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
  For more info visit https://webpack.js.org/guides/code-splitting/

  webpack 5.51.1 compiled with 3 warnings in 17133 ms
  Done in 19.32s.

During one instance of the aspnetcore build at v6.0.3 with node.js installed on the buld host, these warnings from webpack were then translated to errors in the build.

Subsquent to this patch update, the same build error did not occur.

After a review of later build logs, the --restore and --no-test options were added to the call to aspnetcore build.sh.

There might be a build dependency on some version of node.js and corresponding -dev packages on the Linux build host.

(cherry picked from commit 87cae46994f672930e1f2cce2c4410716ddf4baa)