We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 91ec0e1 commit 55cdfdcCopy full SHA for 55cdfdc
packages/ngtools/webpack/src/compiler_host.ts
@@ -147,13 +147,15 @@ export class WebpackCompilerHost implements ts.CompilerHost {
147
const filePath = this.resolve(fileName);
148
149
try {
150
+ let content: ArrayBuffer;
151
if (this._memoryHost.isFile(filePath)) {
- return virtualFs.fileBufferToString(this._memoryHost.read(filePath));
152
+ content = this._memoryHost.read(filePath);
153
} else {
- const content = this._syncHost.read(filePath);
154
-
155
- return virtualFs.fileBufferToString(content);
+ content = this._syncHost.read(filePath);
156
}
+
157
+ // strip BOM
158
+ return virtualFs.fileBufferToString(content).replace(/^\uFEFF/, '');
159
} catch {
160
return undefined;
161
0 commit comments