Skip to content
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

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

spchamp
Copy link
Contributor

@spchamp spchamp commented Apr 10, 2022

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 87cae46)

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
  ./AuthenticationService.ts 13.3 KiB [built] [code generated]
    Statement (ExpressionStatement) with side effects in source code at 2:0-62
    ModuleConcatenation bailout: Module is not an ECMAScript module
  ./node_modules/oidc-client/lib/oidc-client.min.js 280 KiB [built] [code generated]
    CommonJS bailout: this is used directly at 1:225-229
    CommonJS bailout: module.exports is used directly at 1:70-84
    Statement (ExpressionStatement) with side effects in source code at 1:0-49:44353
    ModuleConcatenation bailout: Module is not an ECMAScript module

/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.
~~~~

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. This section in
the build may require a node.js implementation in the build host
environment.

(cherry picked from commit 87cae46)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant