Skip to content

Commit ce17094

Browse files
alan-agius4filipesilva
authored andcommitted
refactor(@angular-devkit/build-angular): lazy require speed-measure-webpack-plugin
1 parent ee14ab0 commit ce17094

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@
117117
"@types/resolve": "^1.17.1",
118118
"@types/rimraf": "^3.0.0",
119119
"@types/semver": "^7.0.0",
120+
"@types/speed-measure-webpack-plugin": "^1.3.0",
120121
"@types/text-table": "^0.2.1",
121122
"@types/universal-analytics": "^0.4.2",
122123
"@types/uuid": "^8.0.0",

packages/angular_devkit/build_angular/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ ts_library(
127127
"@npm//@types/node",
128128
"@npm//@types/rimraf",
129129
"@npm//@types/semver",
130+
"@npm//@types/speed-measure-webpack-plugin",
130131
"@npm//@types/text-table",
131132
"@npm//@types/webpack",
132133
"@npm//@types/webpack-dev-server",

packages/angular_devkit/build_angular/src/utils/webpack-browser-config.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ import { getEsVersionForFileName } from '../webpack/utils/helpers';
3030
import { profilingEnabled } from './environment-options';
3131
import { I18nOptions, configureI18nBuild } from './i18n-options';
3232

33-
const SpeedMeasurePlugin = require('speed-measure-webpack-plugin');
34-
3533
export type BrowserWebpackConfigOptions = WebpackConfigOptions<NormalizedBrowserBuilderSchema>;
3634

3735
export async function generateWebpackConfig(
@@ -109,6 +107,7 @@ export async function generateWebpackConfig(
109107
wco.differentialLoadingMode,
110108
);
111109

110+
const SpeedMeasurePlugin = await import('speed-measure-webpack-plugin');
112111
const smp = new SpeedMeasurePlugin({
113112
outputFormat: 'json',
114113
outputTarget: path.resolve(

yarn.lock

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1657,6 +1657,13 @@
16571657
resolved "https://registry.yarnpkg.com/@types/source-list-map/-/source-list-map-0.1.2.tgz#0078836063ffaf17412349bba364087e0ac02ec9"
16581658
integrity sha512-K5K+yml8LTo9bWJI/rECfIPrGgxdpeNbj+d53lwN4QjW1MCwlkhUms+gtdzigTeUyBr09+u8BwOIY3MXvHdcsA==
16591659

1660+
"@types/speed-measure-webpack-plugin@^1.3.0":
1661+
version "1.3.0"
1662+
resolved "https://registry.yarnpkg.com/@types/speed-measure-webpack-plugin/-/speed-measure-webpack-plugin-1.3.0.tgz#406a4ba9c087ecbad01266a3c9b206c7bb99bc24"
1663+
integrity sha512-p3gUQy1dqcdg67tjrKPjvBBsaSM3y28Za7DcT3sAyztzshGuZd6uKO+TT40JsfJAkyDrdRF2szk/CNjQhOQ0Bg==
1664+
dependencies:
1665+
"@types/webpack" "*"
1666+
16601667
"@types/tapable@*":
16611668
version "1.0.6"
16621669
resolved "https://registry.yarnpkg.com/@types/tapable/-/tapable-1.0.6.tgz#a9ca4b70a18b270ccb2bc0aaafefd1d486b7ea74"

0 commit comments

Comments
 (0)