Skip to content

Commit af629c5

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 ac97292 commit af629c5

File tree

3 files changed

+28
-21
lines changed

3 files changed

+28
-21
lines changed

packages/ngtools/webpack/BUILD.bazel

Lines changed: 18 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,20 @@ 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",
5962
srcs = [":webpack_test_lib"],
60-
deps = [
61-
"@npm//jasmine",
62-
"@npm//source-map",
63-
"@npm//tslib",
64-
],
6563
)
6664

6765
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';

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"@angular/ssr": ["./packages/angular/ssr"],
3232
"@angular/*": ["./packages/angular/*/src"],
3333
"@angular/build/private": ["./packages/angular/build/src/private"],
34-
"@ngtools/webpack": ["./packages/ngtools/webpack/src"],
34+
"@ngtools/webpack": ["./packages/ngtools/webpack/index"],
3535
"@schematics/angular": ["./packages/schematics/angular"]
3636
}
3737
},

0 commit comments

Comments
 (0)