fix(bazel): ng_package includes transitive .d.ts and flatModuleMetadata (#22499)
Fixes #22419 PR Close #22499
This commit is contained in:
@ -17,9 +17,5 @@ ng_package(
|
||||
],
|
||||
entry_point = "packages/bazel/test/ng_package/example/index.js",
|
||||
secondary_entry_points = ["secondary"],
|
||||
deps = [
|
||||
":example",
|
||||
# FIXME(#22419)
|
||||
"//packages/bazel/test/ng_package/example/secondary",
|
||||
],
|
||||
deps = [":example"],
|
||||
)
|
||||
|
@ -1 +1,9 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
export * from './mymodule';
|
@ -1,4 +1,13 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {NgModule} from '@angular/core';
|
||||
import {a} from './secondary/secondarymodule';
|
||||
|
||||
@NgModule({})
|
||||
export class MyModule {
|
||||
|
@ -1 +1,9 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
export * from './secondarymodule';
|
||||
|
@ -1,5 +1,15 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {NgModule} from '@angular/core';
|
||||
|
||||
@NgModule({})
|
||||
export class SecondaryModule {
|
||||
}
|
||||
|
||||
export const a = 1;
|
||||
|
@ -41,6 +41,16 @@ describe('ng_package', () => {
|
||||
expect(shx.ls('-R', 'esm5').stdout.split('\n').filter(n => !!n).sort()).toEqual(expected);
|
||||
expect(shx.ls('-R', 'esm2015').stdout.split('\n').filter(n => !!n).sort()).toEqual(expected);
|
||||
});
|
||||
it('should have right secondary sources', () => {
|
||||
const expected = [
|
||||
'index.d.ts',
|
||||
'package.json',
|
||||
'secondary.d.ts',
|
||||
'secondary.metadata.json',
|
||||
'secondarymodule.d.ts',
|
||||
];
|
||||
expect(shx.ls('-R', 'secondary').stdout.split('\n').filter(n => !!n).sort()).toEqual(expected);
|
||||
});
|
||||
it('should have main entry point package.json properties set', () => {
|
||||
const packageJson = JSON.parse(fs.readFileSync('package.json', UTF8));
|
||||
expect(packageJson['main']).toBe('./bundles/example.umd.js');
|
||||
|
Reference in New Issue
Block a user