mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
build: expose locales as package export for ES module resolution (#43431)
As part of v13, all APF packages use the `exports` field which defines the public entry-points/mappings for a package. so-called package exports. The `ng_package` rule creates all the necessary mappings/sub-path exports for the entry-points of `@angular/common`. Though, since the locale files are generated separately and are not an actual entry-point, we need to expose these files publicly so that they can be imported/resolved by consumers. PR Close #43431
This commit is contained in:
committed by
Dylan Hunn
parent
4b142c4ead
commit
c7d37f74cf
@@ -114,6 +114,8 @@ describe('@angular/common ng_package', () => {
|
||||
node: './fesm2015/upgrade.mjs',
|
||||
default: './fesm2020/upgrade.mjs',
|
||||
},
|
||||
'./locales/global/*': {default: './locales/global/*.js'},
|
||||
'./locales/*': {default: './locales/*.mjs'},
|
||||
}
|
||||
}));
|
||||
});
|
||||
|
||||
@@ -11,6 +11,14 @@
|
||||
"dependencies": {
|
||||
"tslib": "^2.3.0"
|
||||
},
|
||||
"exports": {
|
||||
"./locales/global/*": {
|
||||
"default": "./locales/global/*.js"
|
||||
},
|
||||
"./locales/*": {
|
||||
"default": "./locales/*.mjs"
|
||||
}
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@angular/core": "0.0.0-PLACEHOLDER",
|
||||
"rxjs": "^6.5.3 || ^7.0.0"
|
||||
|
||||
Reference in New Issue
Block a user