fix(compiler): don’t emit metadata for generated files
This commit is contained in:
parent
de978229b2
commit
43e0fa513b
|
@ -60,6 +60,8 @@ export class TsickleHost extends DelegatingHost {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const IGNORED_FILES = /\.ngfactory\.js$|\.css\.js$|\.css\.shim\.js$/;
|
||||||
|
|
||||||
export class MetadataWriterHost extends DelegatingHost {
|
export class MetadataWriterHost extends DelegatingHost {
|
||||||
private reflectorHost: NodeReflectorHost;
|
private reflectorHost: NodeReflectorHost;
|
||||||
constructor(delegate: ts.CompilerHost, program: ts.Program, options: ts.CompilerOptions,
|
constructor(delegate: ts.CompilerHost, program: ts.Program, options: ts.CompilerOptions,
|
||||||
|
@ -80,6 +82,10 @@ export class MetadataWriterHost extends DelegatingHost {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (IGNORED_FILES.test(fileName)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!sourceFiles) {
|
if (!sourceFiles) {
|
||||||
throw new Error('Metadata emit requires the sourceFiles are passed to WriteFileCallback. ' +
|
throw new Error('Metadata emit requires the sourceFiles are passed to WriteFileCallback. ' +
|
||||||
'Update to TypeScript ^1.9.0-dev');
|
'Update to TypeScript ^1.9.0-dev');
|
||||||
|
|
Loading…
Reference in New Issue