fix(bazel): flat module misses AMD module name on windows (#27839)
* Fixes that the flat module out files do not have a proper AMD module name on Windows. This is currently blocking serving a `ng_module` using the Bazel TypeScript `devserver` on Windows. PR Close #27839
This commit is contained in:

committed by
Andrew Kushnir

parent
84857a267c
commit
aa7f2c8dc7
40
packages/bazel/test/ngc-wrapped/flat_module_test.ts
Normal file
40
packages/bazel/test/ngc-wrapped/flat_module_test.ts
Normal file
@ -0,0 +1,40 @@
|
||||
/**
|
||||
* @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 {obsoleteInIvy, onlyInIvy} from '@angular/private/testing';
|
||||
import {existsSync, readFileSync} from 'fs';
|
||||
import {dirname, join} from 'path';
|
||||
|
||||
describe('flat_module ng_module', () => {
|
||||
|
||||
let packageOutput: string;
|
||||
let flatModuleOutFile: string;
|
||||
|
||||
beforeAll(() => {
|
||||
packageOutput =
|
||||
dirname(require.resolve('angular/packages/bazel/test/ngc-wrapped/flat_module/index.js'));
|
||||
flatModuleOutFile = join(packageOutput, 'flat_module.js');
|
||||
});
|
||||
|
||||
it('should have a flat module out file',
|
||||
() => { expect(existsSync(flatModuleOutFile)).toBe(true); });
|
||||
|
||||
describe('flat module out file', () => {
|
||||
|
||||
obsoleteInIvy('Ngtsc computes the AMD module name differently than NGC')
|
||||
.it('should have a proper AMD module name', () => {
|
||||
expect(readFileSync(flatModuleOutFile, 'utf8'))
|
||||
.toContain(`define("flat_module/flat_module"`);
|
||||
});
|
||||
|
||||
onlyInIvy('Ngtsc computes the AMD module name differently than NGC')
|
||||
.it('should have a proper AMD module name', () => {
|
||||
expect(readFileSync(flatModuleOutFile, 'utf8')).toContain(`define("flat_module"`);
|
||||
});
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user