Skip to content

Commit 8804db9

Browse files
committed
build: migrate @ngtools/webpack to ts_project
The `@ngtools/webpack` package has been migrated to the `rules_js` ts_project rule. Other than the `index.ts` addition, no code changes were needed.
1 parent 5cc62d4 commit 8804db9

File tree

3 files changed

+29
-21
lines changed

3 files changed

+29
-21
lines changed

packages/angular_devkit/build_angular/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ ts_project(
126126
"//packages/angular_devkit/build_webpack",
127127
"//packages/angular_devkit/core",
128128
"//packages/angular_devkit/core/node",
129-
"//packages/ngtools/webpack",
130129
],
131130
module_name = "@angular-devkit/build-angular",
132131
deps = [
@@ -202,6 +201,7 @@ ts_project(
202201
"//:root_modules/webpack-merge",
203202
"//:root_modules/webpack-subresource-integrity",
204203
"//packages/angular_devkit/architect",
204+
"//packages/ngtools/webpack",
205205
],
206206
)
207207

packages/ngtools/webpack/BUILD.bazel

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55

66
load("@npm//@angular/build-tooling/bazel/api-golden:index.bzl", "api_golden_test_npm_package")
77
load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test")
8-
load("//tools:defaults.bzl", "pkg_npm", "ts_library")
8+
load("//tools:defaults.bzl", "pkg_npm")
9+
load("//tools:interop.bzl", "ts_project")
910

1011
licenses(["notice"])
1112

1213
package(default_visibility = ["//visibility:public"])
1314

14-
ts_library(
15+
ts_project(
1516
name = "webpack",
16-
package_name = "@ngtools/webpack",
1717
srcs = glob(
1818
include = [
1919
"src/**/*.ts",
@@ -22,21 +22,22 @@ ts_library(
2222
"src/**/*_spec.ts",
2323
"src/**/*_spec_helpers.ts",
2424
],
25-
),
25+
) + [
26+
"index.ts",
27+
],
2628
data = [
2729
"package.json",
2830
],
2931
module_name = "@ngtools/webpack",
30-
module_root = "src/index.d.ts",
3132
deps = [
32-
"@npm//@angular/compiler-cli",
33-
"@npm//@types/node",
34-
"@npm//typescript",
35-
"@npm//webpack",
33+
"//:root_modules/@angular/compiler-cli",
34+
"//:root_modules/@types/node",
35+
"//:root_modules/typescript",
36+
"//:root_modules/webpack",
3637
],
3738
)
3839

39-
ts_library(
40+
ts_project(
4041
name = "webpack_test_lib",
4142
testonly = True,
4243
srcs = glob(
@@ -45,23 +46,21 @@ ts_library(
4546
"src/**/*_spec_helpers.ts",
4647
],
4748
),
48-
deps = [
49-
":webpack",
49+
interop_deps = [
5050
"//packages/angular_devkit/core",
51-
"@npm//@angular/compiler",
52-
"@npm//jasmine",
53-
"@npm//typescript",
51+
],
52+
deps = [
53+
":webpack_rjs",
54+
"//:root_modules/@angular/compiler",
55+
"//:root_modules/@types/jasmine",
56+
"//:root_modules/typescript",
5457
],
5558
)
5659

5760
jasmine_node_test(
5861
name = "webpack_test",
62+
size = "small",
5963
srcs = [":webpack_test_lib"],
60-
deps = [
61-
"@npm//jasmine",
62-
"@npm//source-map",
63-
"@npm//tslib",
64-
],
6564
)
6665

6766
genrule(

packages/ngtools/webpack/index.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.dev/license
7+
*/
8+
9+
export * from './src/index';

0 commit comments

Comments
 (0)