Skip to content

Commit 8b5449d

Browse files
committed
refactor(@angular-devkit/build-optimizer): remove redundant webpack-sources dependency
The `webpack` package now exports the `Source` based classes directly.
1 parent dd0fd18 commit 8b5449d

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

packages/angular_devkit/build_optimizer/BUILD.bazel

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ ts_library(
3535
module_root = "src/index.d.ts",
3636
deps = [
3737
"@npm//@types/node",
38-
"@npm//@types/webpack",
39-
"@npm//@types/webpack-sources",
4038
"@npm//source-map",
4139
"@npm//tslib",
4240
"@npm//typescript",

packages/angular_devkit/build_optimizer/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
"loader-utils": "2.0.0",
1313
"source-map": "0.7.3",
1414
"tslib": "2.2.0",
15-
"typescript": "4.2.4",
16-
"webpack-sources": "2.2.0"
15+
"typescript": "4.2.4"
1716
},
1817
"peerDependencies": {
1918
"webpack": "^5.30.0"

packages/angular_devkit/build_optimizer/src/build-optimizer/webpack-loader.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88
import { RawSourceMap } from 'source-map';
9-
import { SourceMapSource } from 'webpack-sources';
9+
import { sources } from 'webpack';
1010
const loaderUtils = require('loader-utils');
1111

1212
import { buildOptimizer } from './build-optimizer';
@@ -72,7 +72,7 @@ export default function buildOptimizerLoader(
7272

7373
if (previousSourceMap) {
7474
// Use http://sokra.github.io/source-map-visualization/ to validate sourcemaps make sense.
75-
newSourceMap = new SourceMapSource(
75+
newSourceMap = new sources.SourceMapSource(
7676
newContent,
7777
this.resourcePath,
7878
intermediateSourceMap,

0 commit comments

Comments
 (0)