fix(bazel): Give correct module names for ES6 output (#21320)
Fixes #21022 PR Close #21320
This commit is contained in:
parent
463e2872a6
commit
9728dce048
@ -27,6 +27,8 @@ const ALLOW_NON_HERMETIC_READS = true;
|
|||||||
// Note: We compile the content of node_modules with plain ngc command line.
|
// Note: We compile the content of node_modules with plain ngc command line.
|
||||||
const ALL_DEPS_COMPILED_WITH_BAZEL = false;
|
const ALL_DEPS_COMPILED_WITH_BAZEL = false;
|
||||||
|
|
||||||
|
const NODE_MODULES = 'node_modules/';
|
||||||
|
|
||||||
export function main(args) {
|
export function main(args) {
|
||||||
if (runAsWorker(args)) {
|
if (runAsWorker(args)) {
|
||||||
runWorkerLoop(runOneBuild);
|
runWorkerLoop(runOneBuild);
|
||||||
@ -175,7 +177,11 @@ export function compile({allowNonHermeticReads, allDepsCompiledWithBazel = true,
|
|||||||
ngHost.amdModuleName) {
|
ngHost.amdModuleName) {
|
||||||
return ngHost.amdModuleName({ fileName: importedFilePath } as ts.SourceFile);
|
return ngHost.amdModuleName({ fileName: importedFilePath } as ts.SourceFile);
|
||||||
}
|
}
|
||||||
return relativeToRootDirs(importedFilePath, compilerOpts.rootDirs).replace(EXT, '');
|
const result = relativeToRootDirs(importedFilePath, compilerOpts.rootDirs).replace(EXT, '');
|
||||||
|
if (result.startsWith(NODE_MODULES)) {
|
||||||
|
return result.substr(NODE_MODULES.length);
|
||||||
|
}
|
||||||
|
return bazelOpts.workspaceName + '/' + result;
|
||||||
};
|
};
|
||||||
ngHost.toSummaryFileName = (fileName: string, referringSrcFileName: string) =>
|
ngHost.toSummaryFileName = (fileName: string, referringSrcFileName: string) =>
|
||||||
relativeToRootDirs(fileName, compilerOpts.rootDirs).replace(EXT, '');
|
relativeToRootDirs(fileName, compilerOpts.rootDirs).replace(EXT, '');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user