Skip to content

Commit 27ca66c

Browse files
alan-agius4filipesilva
authored andcommittedMay 18, 2020
fix(@angular-devkit/build-angular): add link when displaying commonJS usage warnings
Add a link to https://web.dev/commonjs-larger-bundles when a commonJS module is used in browsers builds
1 parent 6d0f13b commit 27ca66c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎packages/angular_devkit/build_angular/src/angular-cli-files/plugins/common-js-usage-warn-plugin.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ export class CommonJsUsageWarnPlugin {
8181
// And if the issuer request is not from 'webpack-dev-server', as 'webpack-dev-server'
8282
// will require CommonJS libraries for live reloading such as 'sockjs-node'.
8383
if (mainIssuer?.name === 'main' && !issuer?.userRequest?.includes('webpack-dev-server')) {
84-
const warning = `${issuer?.userRequest} depends on ${rawRequest}. CommonJS or AMD dependencies can cause optimization bailouts.`;
84+
const warning = `${issuer?.userRequest} depends on ${rawRequest}. CommonJS or AMD dependencies can cause optimization bailouts.\n` +
85+
'For more info see: https://web.dev/commonjs-larger-bundles';
8586

8687
// Avoid showing the same warning multiple times when in 'watch' mode.
8788
if (!this.shownWarnings.has(warning)) {

0 commit comments

Comments
 (0)
Please sign in to comment.