From 70f93a640bbdd50ee933e71085fad799b04a2e5e Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Tue, 2 Nov 2021 15:06:10 +0100 Subject: [PATCH] refactor(localize): ensure schematic code runs as commonjs (#44016) The schematic code in `@angular/localize` is currently still emitted as CommonJS, while the rest of `@angular/localize` is strict ESM (which is also denoted through `type: module` in the package.json file). The schematic code is currently imported as CJS from the CLI so it is not a problem right now. Still, it is safer to ensure the code for schematics is properly picked up as CJS through a local `package.json` file resetting `type: module` to `type: commonjs`. PR Close #44016 --- packages/localize/schematics/BUILD.bazel | 5 ++--- packages/localize/schematics/package.json | 3 +++ 2 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 packages/localize/schematics/package.json diff --git a/packages/localize/schematics/BUILD.bazel b/packages/localize/schematics/BUILD.bazel index 30aed92bdec..79558ee2975 100644 --- a/packages/localize/schematics/BUILD.bazel +++ b/packages/localize/schematics/BUILD.bazel @@ -6,15 +6,14 @@ filegroup( name = "package_assets", srcs = [ "collection.json", + "package.json", ], visibility = ["//packages/localize:__subpackages__"], ) pkg_npm( name = "npm_package", - srcs = [ - "collection.json", - ], + srcs = [":package_assets"], deps = [ "//packages/localize/schematics/ng-add", ], diff --git a/packages/localize/schematics/package.json b/packages/localize/schematics/package.json new file mode 100644 index 00000000000..5bbefffbabe --- /dev/null +++ b/packages/localize/schematics/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +}